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
|
|---|---|---|---|---|---|
16be09170206b1c5a87d1bfbcf267dd2a64b77d0
|
diff --git a/rllib/rollout.py b/rllib/rollout.py
index <HASH>..<HASH> 100755
--- a/rllib/rollout.py
+++ b/rllib/rollout.py
@@ -506,7 +506,7 @@ def rollout(agent,
episodes += 1
-if __name__ == "__main__":
+def main():
parser = create_parser()
args = parser.parse_args()
@@ -522,3 +522,7 @@ if __name__ == "__main__":
"--out as well!")
run(args, parser)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/rllib/train.py b/rllib/train.py
index <HASH>..<HASH> 100755
--- a/rllib/train.py
+++ b/rllib/train.py
@@ -257,7 +257,11 @@ def run(args, parser):
ray.shutdown()
-if __name__ == "__main__":
+def main():
parser = create_parser()
args = parser.parse_args()
run(args, parser)
+
+
+if __name__ == "__main__":
+ main()
|
[RLlib] Refactor `if __name__ == "__main__"` into `main()` method in rollout/train.py for better reusability (#<I>)
|
ray-project_ray
|
train
|
py,py
|
27e96340c9cadca359c33e90efbc69097598851b
|
diff --git a/salt/config.py b/salt/config.py
index <HASH>..<HASH> 100644
--- a/salt/config.py
+++ b/salt/config.py
@@ -1722,6 +1722,8 @@ def get_id(root_dir=None, minion_id=False, cache=True):
with salt.utils.fopen('/etc/hosts') as hfl:
for line in hfl:
names = line.split()
+ if not names:
+ continue # empty line in hosts
ip_ = names.pop(0)
if ip_.startswith('127.'):
for name in names:
|
Added /etc/host check for empty lines
|
saltstack_salt
|
train
|
py
|
bc6a60dae563ec3c8842b26d1f30081ceb6a1171
|
diff --git a/libnetwork/drivers/overlay/encryption.go b/libnetwork/drivers/overlay/encryption.go
index <HASH>..<HASH> 100644
--- a/libnetwork/drivers/overlay/encryption.go
+++ b/libnetwork/drivers/overlay/encryption.go
@@ -488,7 +488,7 @@ func updateNodeKey(lIP, rIP net.IP, idxs []*spi, curKeys []*key, newIdx, priIdx,
if delIdx != -1 {
// -rSA0
- programSA(rIP, lIP, spis[delIdx], nil, reverse, false)
+ programSA(lIP, rIP, spis[delIdx], nil, reverse, false)
}
if newIdx > -1 {
|
Fix bug in ipsec key rotation
- which would leave a stale state behind
at each key rotation.
|
moby_moby
|
train
|
go
|
74d3571b114b5f9f1d4de65839000fed1090805c
|
diff --git a/ph-commons/src/main/java/com/helger/commons/collection/ext/ICommonsList.java b/ph-commons/src/main/java/com/helger/commons/collection/ext/ICommonsList.java
index <HASH>..<HASH> 100644
--- a/ph-commons/src/main/java/com/helger/commons/collection/ext/ICommonsList.java
+++ b/ph-commons/src/main/java/com/helger/commons/collection/ext/ICommonsList.java
@@ -94,7 +94,7 @@ public interface ICommonsList <ELEMENTTYPE> extends
/**
* Special forEach that takes an {@link ObjIntConsumer} which is provided the
* value AND the index.
- *
+ *
* @param aConsumer
* The consumer to use. May not be <code>null</code>.
*/
@@ -205,7 +205,7 @@ public interface ICommonsList <ELEMENTTYPE> extends
}
@Nonnull
- default ICommonsList <ELEMENTTYPE> getSorted (@Nonnull final Comparator <? super ELEMENTTYPE> aComparator)
+ default ICommonsList <ELEMENTTYPE> getSortedInline (@Nonnull final Comparator <? super ELEMENTTYPE> aComparator)
{
sort (aComparator);
return this;
|
Changed to getSortedInline
|
phax_ph-commons
|
train
|
java
|
6ddac1fb86c87d4d495e11e0838bf755103e64a6
|
diff --git a/Templating/LegacyEngine.php b/Templating/LegacyEngine.php
index <HASH>..<HASH> 100644
--- a/Templating/LegacyEngine.php
+++ b/Templating/LegacyEngine.php
@@ -68,6 +68,8 @@ class LegacyEngine implements EngineInterface
$tpl = eZTemplate::factory();
foreach ( $parameters as $varName => $param )
{
+ // If $param is an array, we recursively convert all objects contained in it (if any).
+ // Scalar parameters are passed as is
if ( is_array( $param ) )
{
array_walk_recursive(
|
Added comments in Templating\LegacyEngine
|
ezsystems_LegacyBridge
|
train
|
php
|
0dfffca144d9c6f14a53f4aa50f2b84ffeae7b7e
|
diff --git a/psamm/command.py b/psamm/command.py
index <HASH>..<HASH> 100644
--- a/psamm/command.py
+++ b/psamm/command.py
@@ -113,6 +113,31 @@ class MetabolicMixin(object):
self._mm = self._model.create_metabolic_model()
+class ObjectiveMixin(object):
+ """Mixin for commands that use biomass as objective.
+
+ Allows the user to override the default objective from the command line.
+ """
+
+ @classmethod
+ def init_parser(cls, parser):
+ parser.add_argument('--objective', help='Reaction to use as objective')
+ super(ObjectiveMixin, cls).init_parser(parser)
+
+ def _get_objective(self, log=True):
+ if self._args.objective is not None:
+ reaction = self._args.objective
+ else:
+ reaction = self._model.get_biomass_reaction()
+ if reaction is None:
+ self.argument_error('The objective reaction was not specified')
+
+ if log:
+ logger.info('Using {} as objective'.format(reaction))
+
+ return reaction
+
+
class LoopRemovalMixin(object):
"""Mixin for commands that perform loop removal."""
|
command: Add ObjectiveMixin for commands taking optional objective
|
zhanglab_psamm
|
train
|
py
|
b40ad09b68ec50cebec28830acf647bed5f746ce
|
diff --git a/share/previews.js b/share/previews.js
index <HASH>..<HASH> 100644
--- a/share/previews.js
+++ b/share/previews.js
@@ -49,7 +49,8 @@ var getContentHeight = (function() {
var els = bodyEl.getElementsByTagName('*');
var elHeights = [];
for (var i = 0, l = els.length; i < l; i++) {
- elHeights.push(els[i].offsetTop + els[i].offsetHeight);
+ elHeights.push(els[i].offsetTop + els[i].offsetHeight +
+ parseInt(window.getComputedStyle(els[i], null).getPropertyValue('margin-bottom')));
}
var height = Math.max.apply(Math, elHeights);
height += parseInt(bodyStyle.getPropertyValue('padding-bottom'), 10);
|
Include bottom margin of last element in document height calculation
|
jacobrask_styledocco
|
train
|
js
|
cb1e820633b358b95a8be8e0eb19530f842c32ac
|
diff --git a/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java b/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
index <HASH>..<HASH> 100644
--- a/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
+++ b/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
@@ -301,6 +301,12 @@ public class DefaultAlertService extends DefaultJPAService implements AlertServi
_logger.warn(logMessage);
continue;
}
+
+ if(!alert.isEnabled()) {
+ logMessage = MessageFormat.format("Alert {0} has been disabled. Will not evaluate.", alertID);
+ _logger.warn(logMessage);
+ continue;
+ }
History history = _historyService.createHistory(addDateToMessage(JobStatus.STARTED.getDescription()), alert, JobStatus.STARTED, 0, 0);
|
Check if alert has been disabled before evaluation.
|
salesforce_Argus
|
train
|
java
|
1ab13b2ebc2349d1587fce35984920d5fe8480e9
|
diff --git a/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java b/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java
index <HASH>..<HASH> 100644
--- a/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java
+++ b/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java
@@ -1279,12 +1279,13 @@ public class StatementGenerator extends TreeVisitor {
for (CatchClause cc : node.getCatchClauses()) {
if (cc.getException().getType() instanceof UnionType) {
printMultiCatch(cc);
+ } else {
+ buffer.append("@catch (");
+ cc.getException().accept(this);
+ buffer.append(") {\n");
+ printStatements(cc.getBody().getStatements());
+ buffer.append("}\n");
}
- buffer.append("@catch (");
- cc.getException().accept(this);
- buffer.append(") {\n");
- printStatements(cc.getBody().getStatements());
- buffer.append("}\n");
}
if (node.getFinally() != null) {
|
No Exception catch clause after a multi-catch
|
google_j2objc
|
train
|
java
|
4dfd892dfae5d9aa4b8284c9c881709bc098ddfb
|
diff --git a/components/router.go b/components/router.go
index <HASH>..<HASH> 100644
--- a/components/router.go
+++ b/components/router.go
@@ -69,9 +69,11 @@ func (r *Router) HandleUp(p core.Packet, an core.AckNacker, upAdapter core.Adapt
return err
}
- // We don't handle downlink for now, so an is quite useless.
-
- return upAdapter.Send(p, brokers...)
+ response, err := upAdapter.Send(p, brokers...)
+ if err != nil {
+ return err
+ }
+ return an.Ack(response)
}
// ok ensure the router has been initialized by NewRouter()
|
[broker] Make router compliant to send signature
|
TheThingsNetwork_ttn
|
train
|
go
|
fea371d34254e5e7071e0332f8893484b2b716e7
|
diff --git a/number/currency.js b/number/currency.js
index <HASH>..<HASH> 100644
--- a/number/currency.js
+++ b/number/currency.js
@@ -28,8 +28,7 @@ module.exports = memoize(function (db) {
}, {
toString: { value: function (descriptor) {
var num = 0, step, prefix;
- step = (descriptor && !isNaN(descriptor.step))
- ? Math.max(descriptor.step, this.constructor.step) : this.constructor.step;
+ step = (descriptor && !isNaN(descriptor.step)) ? descriptor.step : this.constructor.step;
if (step) {
while (step < 1) {
++num;
|
Issue #1. Always honour step from property descriptor.
|
medikoo_dbjs-ext
|
train
|
js
|
f43278a7fc79774e078ade70eeed0aee371a9a75
|
diff --git a/tacl/catalogue.py b/tacl/catalogue.py
index <HASH>..<HASH> 100644
--- a/tacl/catalogue.py
+++ b/tacl/catalogue.py
@@ -49,4 +49,6 @@ class Catalogue (dict):
"""
with open(path, 'wb') as fh:
writer = csv.writer(fh, delimiter=' ')
- writer.writerows(self.items())
+ rows = self.items()
+ rows.sort(key=lambda x: x[0])
+ writer.writerows(rows)
|
Added sorting of catalogue entries when creating a new catalogue.
|
ajenhl_tacl
|
train
|
py
|
4c32b6805735ce73517dce11b9afa9cbfe533d47
|
diff --git a/test/lib/tests.js b/test/lib/tests.js
index <HASH>..<HASH> 100644
--- a/test/lib/tests.js
+++ b/test/lib/tests.js
@@ -34,7 +34,7 @@ const tests = {
'read admin file': function (done) {
this.timeout(2000);
- request(process.env.TEST_PROTOCOL + '://localhost:' + process.env.TEST_PORT + '/adapter/web/index.html', function (error, response, body) {
+ request(process.env.TEST_PROTOCOL + '://localhost:' + process.env.TEST_PORT + '/adapter/web/index_m.html', function (error, response, body) {
expect(error).to.be.not.ok;
expect(response.headers['content-type'].split(';')[0]).to.be.equal('text/html');
expect(response.statusCode).to.be.equal(200);
|
#<I> read admin file loads index_m.html as index.html removed.
|
ioBroker_ioBroker.web
|
train
|
js
|
9dd28865c62865ae235ddc43382606f63f4c82de
|
diff --git a/lib/scss_lint/linter/property_format_linter.rb b/lib/scss_lint/linter/property_format_linter.rb
index <HASH>..<HASH> 100644
--- a/lib/scss_lint/linter/property_format_linter.rb
+++ b/lib/scss_lint/linter/property_format_linter.rb
@@ -17,7 +17,8 @@ module SCSSLint
def description
'Property declarations should always be on one line of the form ' <<
- '`name: value;` or `name: [value] {`'
+ '`name: value;` or `name: [value] {` ' <<
+ '(are you missing a trailing semi-colon?)'
end
private
|
Improve message for property format linter
Changes the lint error description for the property format linter to
suggest that the user is missing a semi-colon, as that usually is the
reason they are seeing the lint, and the more general language of the
error can be confusing the read at times.
Change-Id: I<I>dcb<I>ba<I>e<I>de<I>ab<I>d8bd<I>
Reviewed-on: <URL>
|
sds_scss-lint
|
train
|
rb
|
1787036f2910f1aec76cbc6d7fe9e15547c98200
|
diff --git a/gargoyle/media/js/gargoyle.js b/gargoyle/media/js/gargoyle.js
index <HASH>..<HASH> 100644
--- a/gargoyle/media/js/gargoyle.js
+++ b/gargoyle/media/js/gargoyle.js
@@ -80,6 +80,12 @@ $(document).ready(function () {
1: "(Disabled for everyone)"
};
+ if (status == 3) {
+ if (!confirm('Are you SURE you want to enable this switch globally?')) {
+ return;
+ }
+ }
+
api(GARGOYLE.updateStatus,
{
key: row.attr("data-switch-key"),
|
Add comfirmation dialog to enabling switches globally.
Summary: If a switch is going to the globally enabled for everyone state, make
the user confirm via a dialog box.
Test Plan: Fire up the app and observe that clicking every switch button other
than "Global" works as normal. When clicking "Global" a confirmation appears.
If you click cancel, the change does not go through. If you click okay they
change still occurs.
Reviewers: dcramer
Reviewed By: dcramer
CC: dcramer
Differential Revision: <URL>
|
disqus_gargoyle
|
train
|
js
|
227549635a24ffb6c385c643b40c87d426f341fb
|
diff --git a/test/hash-parity-with-go-ipfs.js b/test/hash-parity-with-go-ipfs.js
index <HASH>..<HASH> 100644
--- a/test/hash-parity-with-go-ipfs.js
+++ b/test/hash-parity-with-go-ipfs.js
@@ -38,7 +38,8 @@ module.exports = (repo) => {
ipldResolver = new IPLDResolver(bs)
})
- it('yields the same tree as go-ipfs', (done) => {
+ it('yields the same tree as go-ipfs', function (done) {
+ this.timeout(10 * 1000)
pull(
pull.values([
{
|
test: Increase timeout of a test
The test in `hash-parity-with-go-ipfs.js` timed out even locally,
hence increasing the timeout to <I> seconds.
|
ipfs_js-ipfs-unixfs
|
train
|
js
|
d97fc38a888f35084a80c49d062e4f508e578e73
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ setup(
keywords=['django', 'admin', 'interface', 'responsive', 'flat', 'theme', 'custom', 'ui'],
requires=['django(>=1.7)'],
install_requires=[
- 'django-colorfield >= 0.1, < 1.0',
+ 'django-colorfield >= 0.2, < 1.0',
'django-flat-theme >= 1.0, < 2.0',
'django-flat-responsive >= 1.0, < 3.0',
'six >= 1.9.0, < 2.0.0',
|
Bumped django-colorfield version to <I>.
|
fabiocaccamo_django-admin-interface
|
train
|
py
|
ee7eb7e77e3f9c54c1c281f71ca184b09b755636
|
diff --git a/cobald/parasites/condor_limits/adapter.py b/cobald/parasites/condor_limits/adapter.py
index <HASH>..<HASH> 100644
--- a/cobald/parasites/condor_limits/adapter.py
+++ b/cobald/parasites/condor_limits/adapter.py
@@ -14,7 +14,10 @@ def query_limits(query_command, key_transform):
except ValueError:
continue
else:
- resource_limits[resource] = float(value)
+ try:
+ resource_limits[resource] = float(value)
+ except ValueError:
+ pass
return resource_limits
|
condor: invalid values are ignored during queries
|
MatterMiners_cobald
|
train
|
py
|
458242ef738d4035d6f5e3c713b8dee59fafb90d
|
diff --git a/lib/compiler/scope.js b/lib/compiler/scope.js
index <HASH>..<HASH> 100644
--- a/lib/compiler/scope.js
+++ b/lib/compiler/scope.js
@@ -19,9 +19,6 @@ class Scope {
this.arg_uid = uid++;
}
- level() {
- return this.next ? (this.next.level() + 1) : 0;
- }
get(name) {
if (this.symbols.hasOwnProperty(name)) {
return this.symbols[name];
@@ -69,7 +66,7 @@ class Scope {
return result;
}
alloc_var(sourcename) {
- var varName, suffix = uid++;// + '_' + this.level();
+ var varName, suffix = uid++;
if (sourcename) {
varName = sourcename + '_' + suffix;
} else {
|
Scope: Remove unused "level" method
|
juttle_juttle
|
train
|
js
|
f0e36d8027bd96002b14be3f210c62a2d9193e6f
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,6 +8,6 @@ setup(name='python-ipmi',
author='Jarrod Johnson',
author_email='jbjohnso@us.ibm.com',
url='http://xcat.sf.net/',
- requires=['pycrypto'],
+ install_requires=['pycrypto'],
packages=['ipmi'],
)
|
Change requires to install_requires
|
openstack_pyghmi
|
train
|
py
|
662f655421dc5cd7effbe6e3f5da528d1b69c65b
|
diff --git a/lib/subproviders/geth_api_double.js b/lib/subproviders/geth_api_double.js
index <HASH>..<HASH> 100644
--- a/lib/subproviders/geth_api_double.js
+++ b/lib/subproviders/geth_api_double.js
@@ -153,6 +153,16 @@ GethApiDouble.prototype.eth_getBlockByHash = function(tx_hash, include_full_tran
this.eth_getBlockByNumber.apply(this, arguments);
};
+GethApiDouble.prototype.eth_getBlockTransactionCountByNumber = function(block_number, callback) {
+ this.state.blockchain.getBlock(block_number, function(err, block) {
+ callback(null, block.transactions.length);
+ });
+}
+
+GethApiDouble.prototype.eth_getBlockTransactionCountByHash = function(block_hash, callback) {
+ this.eth_getBlockTransactionCountByNumber.apply(this, arguments);
+}
+
GethApiDouble.prototype.eth_getTransactionReceipt = function(hash, callback) {
this.state.getTransactionReceipt(hash, function(err, receipt) {
if (err) return callback(err);
|
added eth_getBlockTransactionCountByHash and eth_getBlockTransactionCountByNumber
|
trufflesuite_ganache-core
|
train
|
js
|
7567a5d96538a01715827a3eba57e70d8eedec37
|
diff --git a/encoding/encoding.go b/encoding/encoding.go
index <HASH>..<HASH> 100644
--- a/encoding/encoding.go
+++ b/encoding/encoding.go
@@ -108,7 +108,7 @@ var registeredCodecs = make(map[string]Codec)
// more details.
//
// NOTE: this function must only be called during initialization time (i.e. in
-// an init() function), and is not thread-safe. If multiple Compressors are
+// an init() function), and is not thread-safe. If multiple Codecs are
// registered with the same name, the one registered last will take effect.
func RegisterCodec(codec Codec) {
if codec == nil {
|
documentation: fix typo in RegisterCodec godoc (#<I>)
|
grpc_grpc-go
|
train
|
go
|
b8bbdb9e7a3d05353c722b3f2633ada961b0ca67
|
diff --git a/consul/server_manager/server_manager.go b/consul/server_manager/server_manager.go
index <HASH>..<HASH> 100644
--- a/consul/server_manager/server_manager.go
+++ b/consul/server_manager/server_manager.go
@@ -56,8 +56,8 @@ type ConsulClusterInfo interface {
NumNodes() int
}
-// serverCfg is the thread-safe configuration structure that is used to
-// maintain the list of consul servers in Client.
+// serverCfg is the thread-safe configuration struct used to maintain the
+// list of Consul servers in ServerManager.
//
// NOTE(sean@): We are explicitly relying on the fact that serverConfig will
// be copied onto the stack. Please keep this structure light.
|
Reword comment after moving code into new packages
|
hashicorp_consul
|
train
|
go
|
a0d5c418d0258fe2196e9f659ba331a6bf43cb89
|
diff --git a/databuild/adapters/locmem/models.py b/databuild/adapters/locmem/models.py
index <HASH>..<HASH> 100644
--- a/databuild/adapters/locmem/models.py
+++ b/databuild/adapters/locmem/models.py
@@ -18,6 +18,9 @@ class LocMemSheet(BaseWorkSheet):
def __getitem__(self, key):
return self._values_to_dict(self.data[key])
+ def __len__(self):
+ return self.data.__len__()
+
def _match(self, doc, where):
"""Return True if 'doc' matches the 'where' condition."""
assert isinstance(where, dict), "where is not a dictionary"
|
added __len__ method to sheets
|
databuild_databuild
|
train
|
py
|
2702bfd5e7103d37466272cf1590621891bbc804
|
diff --git a/test/busy.js b/test/busy.js
index <HASH>..<HASH> 100644
--- a/test/busy.js
+++ b/test/busy.js
@@ -48,6 +48,7 @@ allocCluster.test('request().send() to a busy server', 2, function t(cluster, as
one.listen(0, '127.0.0.1', listening);
var twoSubChan;
+ var called = 0;
function listening () {
twoSubChan = two.makeSubChannel({
@@ -58,6 +59,8 @@ allocCluster.test('request().send() to a busy server', 2, function t(cluster, as
one.makeSubChannel({
serviceName: 'server'
}).register('foo', function foo(req, res, arg2, arg3) {
+ called++;
+
assert.ok(Buffer.isBuffer(arg2), 'handler got an arg2 buffer');
assert.ok(Buffer.isBuffer(arg3), 'handler got an arg3 buffer');
res.headers.as = 'raw';
@@ -93,6 +96,7 @@ allocCluster.test('request().send() to a busy server', 2, function t(cluster, as
assert.equals(err.fullType, 'tchannel.busy');
one.close();
+ assert.equal(called, 1);
assert.end();
}
|
test/busy: verify handler only called once
|
uber_tchannel-node
|
train
|
js
|
3e2da13d5b9b53fea6586b668ce8324f73718460
|
diff --git a/test/test_autopep8.py b/test/test_autopep8.py
index <HASH>..<HASH> 100755
--- a/test/test_autopep8.py
+++ b/test/test_autopep8.py
@@ -1205,7 +1205,7 @@ foooo('',
foooo('',
scripts=[''],
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
])
|
Update test to reflect fix in pep8
|
hhatto_autopep8
|
train
|
py
|
407f06924565458743ab2358ee462d6d82187482
|
diff --git a/Core/Executor/ContentManager.php b/Core/Executor/ContentManager.php
index <HASH>..<HASH> 100644
--- a/Core/Executor/ContentManager.php
+++ b/Core/Executor/ContentManager.php
@@ -667,7 +667,7 @@ class ContentManager extends RepositoryExecutor implements MigrationGeneratorInt
}
foreach ($fieldData as $key => $data) {
- if (!in_array($key, $languageCodes)) {
+ if (!in_array($key, $languageCodes, true)) {
return false;
}
}
|
fixup 2 for commit d0c8b1a9f<I>
|
kaliop-uk_ezmigrationbundle
|
train
|
php
|
e666b7cdebad30f77a8a801858440d2d384acec8
|
diff --git a/src/ol/renderer/canvas/ImageLayer.js b/src/ol/renderer/canvas/ImageLayer.js
index <HASH>..<HASH> 100644
--- a/src/ol/renderer/canvas/ImageLayer.js
+++ b/src/ol/renderer/canvas/ImageLayer.js
@@ -129,8 +129,9 @@ CanvasImageLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
const hints = frameState.viewHints;
+ const vectorRenderer = this.vectorRenderer_;
let renderedExtent = frameState.extent;
- if (layerState.extent !== undefined) {
+ if (!vectorRenderer && layerState.extent !== undefined) {
renderedExtent = getIntersection(renderedExtent, layerState.extent);
}
@@ -144,7 +145,6 @@ CanvasImageLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
}
}
let skippedFeatures = this.skippedFeatures_;
- const vectorRenderer = this.vectorRenderer_;
if (vectorRenderer) {
const context = vectorRenderer.context;
const imageFrameState = /** @type {module:ol/PluggableMap~FrameState} */ (assign({}, frameState, {
|
Do not clip the image for vector layers
|
openlayers_openlayers
|
train
|
js
|
eb054adf2a0b821ad577599db59a9bc51f3b125a
|
diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -27,8 +27,8 @@ module.exports = {
enforce: 'pre',
test: /\.tsx?$/,
use: "ts-loader",
- config: {
- project: "./tsconfig-loader.json"
+ options: {
+ configFileName: "./tsconfig-loader.json"
}
},
{
|
Fixing webpack ts-loader config
|
scvodigital_scvo-router
|
train
|
js
|
cd404d56ba15490bab183a122b083d2b46a7377f
|
diff --git a/lib/generate.js b/lib/generate.js
index <HASH>..<HASH> 100644
--- a/lib/generate.js
+++ b/lib/generate.js
@@ -195,6 +195,9 @@ module.exports = function(options, callback){
process(files, next);
});
},
+ save: ['theme_source', 'process', function(next){
+ file.write(baseDir + 'db.json', JSON.stringify(hexo.db.export()), next);
+ }],
generate: ['theme_config', 'theme_layout', 'theme_i18n', 'process', function(next, results){
var themeConfig = freeze(results.theme_config),
themei18n = results.theme_i18n;
|
Generate: export database after process done
|
hexojs_hexo
|
train
|
js
|
74f672e91f26856c406667708665d15d25489e6b
|
diff --git a/src/fancy-tools/wwwcTool.test.js b/src/fancy-tools/wwwcTool.test.js
index <HASH>..<HASH> 100644
--- a/src/fancy-tools/wwwcTool.test.js
+++ b/src/fancy-tools/wwwcTool.test.js
@@ -1,4 +1,11 @@
import WwwcTool from './wwwcTool.js';
+import external from './../externalModules.js';
+
+jest.mock('./../externalModules.js', () => ({
+ cornerstone: {
+ setViewport: jest.fn()
+ }
+}));
// TODO: Not sure if this is the best place to test the tool's strategies?
describe('wwwcTool.js', () => {
|
Fix wwwc tests (need mocked externals)
|
cornerstonejs_cornerstoneTools
|
train
|
js
|
4478583f4969d42892f9692962f58170ac318055
|
diff --git a/nonblock/__init__.py b/nonblock/__init__.py
index <HASH>..<HASH> 100644
--- a/nonblock/__init__.py
+++ b/nonblock/__init__.py
@@ -1,5 +1,5 @@
'''
- Copyright (c) 2015 Timothy Savannah under terms of LGPLv2. You should have received a copy of this LICENSE with this distribution.
+ Copyright (c) 2015-2016 Timothy Savannah under terms of LGPLv2. You should have received a copy of this LICENSE with this distribution.
Contains pure-python functions for non-blocking IO in python
'''
@@ -12,6 +12,6 @@ from .BackgroundWrite import bgwrite, bgwrite_chunk, BackgroundIOPriority
__all__ = ('nonblock_read', 'bgwrite', 'bgwrite_chunk', 'BackgroundIOPriority')
-__version__ = '2.0.0'
-__version_tuple = (2, 0, 0)
+__version__ = '3.0.0'
+__version_tuple = (3, 0, 0)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ if __name__ == '__main__':
long_description = summary
setup(name='python-nonblock',
- version='2.0.0',
+ version='3.0.0',
packages=['nonblock'],
author='Tim Savannah',
author_email='kata198@gmail.com',
|
change version in <I> branch to <I>
|
kata198_python-nonblock
|
train
|
py,py
|
e93f819cbd1201179a4e27e5e8dfec50c37c6280
|
diff --git a/lib/sshkit/command.rb b/lib/sshkit/command.rb
index <HASH>..<HASH> 100644
--- a/lib/sshkit/command.rb
+++ b/lib/sshkit/command.rb
@@ -63,7 +63,7 @@ module SSHKit
end
def clear_stdout_lines
- split_and_clear_stream(@stdout)
+ split_and_clear_stream(:@stdout)
end
def on_stderr(channel, data)
@@ -73,7 +73,7 @@ module SSHKit
end
def clear_stderr_lines
- split_and_clear_stream(@stderr)
+ split_and_clear_stream(:@stderr)
end
def exit_status=(new_exit_status)
@@ -220,8 +220,9 @@ module SSHKit
end
end
- def split_and_clear_stream(stream)
- stream.lines.to_a.tap { stream.clear } # Convert lines enumerable to an array for ruby 1.9
+ def split_and_clear_stream(stream_name)
+ # Convert lines enumerable to an array for ruby 1.9
+ instance_variable_get(stream_name).lines.to_a.tap { instance_variable_set(stream_name, '') }
end
def call_interaction_handler(channel, data, callback_name)
|
Do not mutate @stdout or @stderr strings
Calling @stdout.clear broke airbrussh, and was hard to debug. This commit restores the previous (better) behaviour of simply assigning a new blank string when clearing.
|
capistrano_sshkit
|
train
|
rb
|
995ea00328932ebb568ce925bb84e84ca98b489b
|
diff --git a/activerecord/lib/rails/generators/active_record/session_migration/templates/migration.rb b/activerecord/lib/rails/generators/active_record/session_migration/templates/migration.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/rails/generators/active_record/session_migration/templates/migration.rb
+++ b/activerecord/lib/rails/generators/active_record/session_migration/templates/migration.rb
@@ -1,5 +1,5 @@
class <%= migration_class_name %> < ActiveRecord::Migration
- def up
+ def change
create_table :<%= session_table_name %> do |t|
t.string :session_id, :null => false
t.text :data
@@ -9,8 +9,4 @@ class <%= migration_class_name %> < ActiveRecord::Migration
add_index :<%= session_table_name %>, :session_id
add_index :<%= session_table_name %>, :updated_at
end
-
- def down
- drop_table :<%= session_table_name %>
- end
end
|
Use change in place of up and down in sessions table migration
|
rails_rails
|
train
|
rb
|
ed8c0488f5e7855cfcf0fb519fe94bbb9f669ac8
|
diff --git a/core/core.js b/core/core.js
index <HASH>..<HASH> 100644
--- a/core/core.js
+++ b/core/core.js
@@ -451,7 +451,7 @@ exports._setup = function() {
var tProperty = this.element.css(attr + '-property')
- if (tProperty.search(name) !== -1)
+ if (tProperty.search(' ' + name) !== -1)
return;
var tDelay = this.element.css(attr + '-delay')
|
a trick to handle properties with prefix
|
pureqml_qmlcore
|
train
|
js
|
900ccb5775dc1164f05f719e66b47ca8fe3a67c6
|
diff --git a/AssetBundle.php b/AssetBundle.php
index <HASH>..<HASH> 100644
--- a/AssetBundle.php
+++ b/AssetBundle.php
@@ -25,18 +25,21 @@ class AssetBundle extends \yii\web\AssetBundle
public $css = [
'css/font-awesome.min.css',
];
-
+
/**
- * Initializes the bundle.
- * Set publish options to copy only necessary files (in this case css and font folders)
- * @codeCoverageIgnore
+ * @inherit
*/
- public function init()
- {
- parent::init();
+ public $publishOptions = [
+ 'only' => [
+ "css/*",
+ "fonts/*",
+ ],
+ 'except' => [
+ "less",
+ "scss",
+ "src",
+ ],
+ ];
- $this->publishOptions['beforeCopy'] = function ($from, $to) {
- return preg_match('%(/|\\\\)(fonts|css)%', $from);
- };
- }
+
}
|
Removed closure as it cause serialization issues
Serialization issues on debug log
|
rmrevin_yii2-fontawesome
|
train
|
php
|
1908ae06fb495df678bd86b46cc0620bb85ec2bb
|
diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js
index <HASH>..<HASH> 100644
--- a/lib/form/filemanager.js
+++ b/lib/form/filemanager.js
@@ -450,7 +450,7 @@ M.form_filemanager.init = function(Y, options) {
},
view_files: function(appendfiles) {
this.filemanager.removeClass('fm-updating').removeClass('fm-noitems');
- if ((appendfiles == null) && (!this.options.list || this.options.list.length == 0)) {
+ if ((appendfiles == null) && (!this.options.list || this.options.list.length == 0) && this.viewmode != 2) {
this.filemanager.addClass('fm-noitems');
return;
}
|
MDL-<I>: filemanger: fixed bug with switching to treeview in empty folder
|
moodle_moodle
|
train
|
js
|
97e1d8bbbd51bf3dd56aa3611b1365247398e652
|
diff --git a/src/locale/hy-am.js b/src/locale/hy-am.js
index <HASH>..<HASH> 100644
--- a/src/locale/hy-am.js
+++ b/src/locale/hy-am.js
@@ -8,8 +8,8 @@ var monthsFormat = 'հունվարի_փետրվարի_մարտի_ապրիլի_մ
monthsStandalone = 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_');
export default moment.defineLocale('hy-am', {
- months : function (m, format) {
- if (!m) {
+ months : function (m, format) {
+ if (!m) {
return monthsStandalone;
} else if (/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/.test(format)) {
return monthsFormat[m.month()];
|
I should probably run the code style tests locally...
|
moment_moment
|
train
|
js
|
d4257626adba42b2d3c12e2a1e6f9cb94c904879
|
diff --git a/logrus_test.go b/logrus_test.go
index <HASH>..<HASH> 100644
--- a/logrus_test.go
+++ b/logrus_test.go
@@ -539,7 +539,7 @@ func TestParseLevel(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, TraceLevel, l)
- l, err = ParseLevel("invalid")
+ _, err = ParseLevel("invalid")
assert.Equal(t, "not a valid logrus Level: \"invalid\"", err.Error())
}
|
Fixed ineffectual assignment in test
Don't assign l if it's not being checked/used afterwards.
|
sirupsen_logrus
|
train
|
go
|
205e9df167150e0ac4f0f1e74bbf93b4d65aa7b3
|
diff --git a/spec/validation.rb b/spec/validation.rb
index <HASH>..<HASH> 100644
--- a/spec/validation.rb
+++ b/spec/validation.rb
@@ -82,6 +82,14 @@ describe 'validation' do
end
end
+ it 'ignores validation checks if debugging is set to true' do
+ @rmq.validation.valid?('taco loco', :digits).should == false
+ RubyMotionQuery::RMQ.debugging = true
+ @rmq.validation.valid?('taco loco', :digits).should == true
+ RubyMotionQuery::RMQ.debugging = false
+ @rmq.validation.valid?('taco loco', :digits).should == false
+ end
+
end
end
|
added tests for PR #<I>
|
infinitered_rmq
|
train
|
rb
|
7740b2de2320adec44904cad4ca044f8119a8229
|
diff --git a/lib/core/client_alchemy.js b/lib/core/client_alchemy.js
index <HASH>..<HASH> 100644
--- a/lib/core/client_alchemy.js
+++ b/lib/core/client_alchemy.js
@@ -339,6 +339,7 @@ Alchemy.setMethod(function markLinks(variables, render_data) {
elements,
element,
temp,
+ url,
i;
if (variables.__route) {
@@ -381,6 +382,20 @@ Alchemy.setMethod(function markLinks(variables, render_data) {
}
}
+ // Get all anchors without breadcrumbs
+ elements = document.querySelectorAll('a:not([data-breadcrumb]):not([data-breadcrumbs])');
+
+ for (i = 0; i < elements.length; i++) {
+ element = elements[i];
+ url = RURL.parse(element.href);
+
+ if (alchemy.current_url.pathname == url.pathname) {
+ markLinkElement(element, 1);
+ } else {
+ markLinkElement(element, false);
+ }
+ }
+
// Update breadcrumbs in case of ajax
if (render_data.request && render_data.request.ajax && variables.__breadcrumb_entries) {
|
Also mark anchors without data-breadcrumb attributes as active
|
skerit_alchemy
|
train
|
js
|
74d13300edec76c118408de18769dee46fbffe4b
|
diff --git a/app/models/staypuft/deployment.rb b/app/models/staypuft/deployment.rb
index <HASH>..<HASH> 100644
--- a/app/models/staypuft/deployment.rb
+++ b/app/models/staypuft/deployment.rb
@@ -68,13 +68,12 @@ module Staypuft
platform: Platform::RHEL6 }.merge(attributes),
options)
+ self.hostgroup = Hostgroup.new(name: name, parent: Hostgroup.get_base_hostgroup)
self.nova.nova_network = NovaService::NovaNetwork::FLAT
self.passwords.set_defaults
-
- self.hostgroup = Hostgroup.new(name: name, parent: Hostgroup.get_base_hostgroup)
- self.layout = Layout.where(:name => self.layout_name,
- :networking => self.networking).first
+ self.layout = Layout.where(:name => self.layout_name,
+ :networking => self.networking).first
end
extend AttributeParamStorage
|
Hostgroup of Deployment has to be created before param defaults
|
theforeman_staypuft
|
train
|
rb
|
577cac956b25b2692f6bea947d38500363bf30ee
|
diff --git a/yt_array.py b/yt_array.py
index <HASH>..<HASH> 100644
--- a/yt_array.py
+++ b/yt_array.py
@@ -847,7 +847,7 @@ class YTArray(np.ndarray):
@return_arr
def prod(self, axis=None, dtype=None, out=None):
- if axis:
+ if axis is not None:
units = self.units**self.shape[axis]
else:
units = self.units**self.size
|
Fixing a big bug in the prod function. Truthiness hurts.
--HG--
branch : yt-<I>
|
yt-project_unyt
|
train
|
py
|
bac8837b2be3234474f1b71fe9322be6752e11cb
|
diff --git a/lib/Wei.php b/lib/Wei.php
index <HASH>..<HASH> 100644
--- a/lib/Wei.php
+++ b/lib/Wei.php
@@ -848,10 +848,10 @@ namespace Wei
* Add a service to the service container
*
* @param string $name The name of service
- * @param Base $service The service service
+ * @param object $service The service service
* @return $this
*/
- public function __set($name, Base $service)
+ public function __set($name, $service)
{
return $this->set($name, $service);
}
diff --git a/tests/unit/WeiTest.php b/tests/unit/WeiTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/WeiTest.php
+++ b/tests/unit/WeiTest.php
@@ -491,7 +491,7 @@ class WeiTest extends TestCase
)
));
- // Instance weis
+ // service instances
$wei->request;
$wei->{'sub.request'};
@@ -528,5 +528,8 @@ class WeiTest extends TestCase
{
$this->wei->set('customService', new \stdClass());
$this->assertInstanceOf('stdClass', $this->wei->get('customService'));
+
+ $this->wei->customService2 = new \stdClass();
+ $this->assertInstanceOf('stdClass', $this->wei->customService2);
}
}
|
allows non \Wei\Base object as service through magic setter
|
twinh_wei
|
train
|
php,php
|
6e3f465a6d33a3998999003fd022ee2788c4db4a
|
diff --git a/src/main/java/org/jfrog/hudson/ArtifactoryServer.java b/src/main/java/org/jfrog/hudson/ArtifactoryServer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jfrog/hudson/ArtifactoryServer.java
+++ b/src/main/java/org/jfrog/hudson/ArtifactoryServer.java
@@ -284,11 +284,11 @@ public class ArtifactoryServer implements Serializable {
* @return Preferred credentials for repo resolving. Never null.
*/
public Credentials getResolvingCredentials() {
- if (getResolverCredentials() != null) {
+ if (StringUtils.isNotBlank(getResolverCredentialsId())) {
return getResolverCredentials();
}
- if (getDeployerCredentials() != null) {
+ if (StringUtils.isNotBlank(getDeployerCredentialsId())) {
return getDeployerCredentials();
}
|
HAP-<I> - Add support with Credentials plugin for Artifactory
|
jenkinsci_artifactory-plugin
|
train
|
java
|
4f0dfd62234c49ada6d102ed7b59243dd592f790
|
diff --git a/kubetest/azure_helpers.go b/kubetest/azure_helpers.go
index <HASH>..<HASH> 100644
--- a/kubetest/azure_helpers.go
+++ b/kubetest/azure_helpers.go
@@ -19,6 +19,7 @@ package main
import (
"context"
"fmt"
+ "time"
resources "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
"github.com/Azure/go-autorest/autorest"
@@ -208,6 +209,7 @@ func getClient(env azure.Environment, subscriptionID, tenantID string, armSpt *a
authorizer := autorest.NewBearerAuthorizer(armSpt)
c.deploymentsClient.Authorizer = authorizer
+ c.deploymentsClient.PollingDuration = 60 * time.Minute
c.groupsClient.Authorizer = authorizer
return c
|
"Set deploymentsClient polling Duration to 1 hour"
|
kubernetes_test-infra
|
train
|
go
|
2948aa0282d4929debdb9f83f76ee705f26c8d87
|
diff --git a/account/middleware.py b/account/middleware.py
index <HASH>..<HASH> 100644
--- a/account/middleware.py
+++ b/account/middleware.py
@@ -43,7 +43,11 @@ class TimezoneMiddleware(object):
"""
def process_request(self, request):
- account = getattr(request.user, "account", None)
- if account:
- tz = settings.TIME_ZONE if not account.timezone else account.timezone
- timezone.activate(tz)
+ try:
+ account = getattr(request.user, "account", None)
+ except Account.DoesNotExist:
+ pass
+ else:
+ if account:
+ tz = settings.TIME_ZONE if not account.timezone else account.timezone
+ timezone.activate(tz)
|
Fixed missing account exception in TimezoneMiddleware
Fixes #<I> and #<I>.
|
pinax_django-user-accounts
|
train
|
py
|
f0677251b32c49465d13189308f4b094c67449c6
|
diff --git a/src/python/bezier/triangle.py b/src/python/bezier/triangle.py
index <HASH>..<HASH> 100644
--- a/src/python/bezier/triangle.py
+++ b/src/python/bezier/triangle.py
@@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Helper for B |eacute| zier Triangles / Triangles.
+"""Helper for B |eacute| zier Triangles.
.. |eacute| unicode:: U+000E9 .. LATIN SMALL LETTER E WITH ACUTE
:trim:
|
Removing redundant "Triangles" in `bezier.triangle` docstring.
|
dhermes_bezier
|
train
|
py
|
6c92c40171729233d01ae166b44b63f0dc877a2e
|
diff --git a/maildir-deduplicate.py b/maildir-deduplicate.py
index <HASH>..<HASH> 100755
--- a/maildir-deduplicate.py
+++ b/maildir-deduplicate.py
@@ -27,8 +27,6 @@
You can give a list of mail headers to ignore when comparing mails between each others.
I used this script to clean up a messed maildir folder after I move several mails from a Lotus Notes database.
- Last update: 2010 jun 08
-
Tested on MacOS X 10.6 with python 2.6.2.
"""
|
Don't track last update time of scripts: let this task to Git.
|
kdeldycke_maildir-deduplicate
|
train
|
py
|
7907886bc0d70c92f52f649f78ab424ff32d5b13
|
diff --git a/src/Utility/Import.php b/src/Utility/Import.php
index <HASH>..<HASH> 100644
--- a/src/Utility/Import.php
+++ b/src/Utility/Import.php
@@ -34,31 +34,24 @@ class Import
];
/**
- * Supported field types.
+ * Ignored table columns, by name.
*
* @var array
*/
- private $__supportedFieldTypes = [
- 'string',
- 'email',
- 'text',
- 'url',
- 'reminder',
- 'datetime',
- 'date',
- 'time'
+ private $__ignoreColumns = [
+ 'id',
+ 'created',
+ 'modified',
+ 'trashed'
];
/**
- * Ignored fields, by name.
+ * Ignored table columns, by type.
*
* @var array
*/
- private $__ignoreFields = [
- 'id',
- 'created',
- 'modified',
- 'trashed'
+ private $__ignoreColumnTypes = [
+ 'uuid',
];
/**
|
Better property naming (task #<I>)
|
QoboLtd_cakephp-csv-migrations
|
train
|
php
|
b62e169672ddd6f411d364aa396e559e9b8f1de4
|
diff --git a/src/frontend/org/voltdb/PartitionDRGateway.java b/src/frontend/org/voltdb/PartitionDRGateway.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/PartitionDRGateway.java
+++ b/src/frontend/org/voltdb/PartitionDRGateway.java
@@ -167,18 +167,6 @@ public class PartitionDRGateway implements DurableUniqueIdListener {
public int processDRConflict(int partitionId, long remoteSequenceNumber, DRConflictType drConflictType,
String tableName, ByteBuffer existingTable, ByteBuffer expectedTable,
ByteBuffer newTable, ByteBuffer output) {
- BBContainer cont = DBBPool.wrapBB(existingTable);
- DBBPool.registerUnsafeMemory(cont.address());
- cont.discard();
-
- cont = DBBPool.wrapBB(expectedTable);
- DBBPool.registerUnsafeMemory(cont.address());
- cont.discard();
-
- cont = DBBPool.wrapBB(newTable);
- DBBPool.registerUnsafeMemory(cont.address());
- cont.discard();
-
return 0;
}
|
ENG-<I>, also remove the call of wrap and discard to direct byte buffer.
Change-Id: I<I>ad<I>a<I>afc<I>dc<I>d<I>f<I>e<I>
|
VoltDB_voltdb
|
train
|
java
|
46f52946446e67cc29f6e370a93f6d3d3f2323ad
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -10,14 +10,10 @@ function escapeLuaString(content) {
.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(/"/g, '\\"')
- .replace(/\[/g, '\\[')
- .replace(/\]/g, '\\]')
.replace(/\v/g, '\\v')
.replace(/\t/g, '\\t')
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
- // .replace(/\\b/g, '\\b')
- // .replace(/\a/g, '\\a')
.replace(/\f/g, '\\f');
}
|
Removed `[` and `]` escape
|
ark120202_gulp-moon
|
train
|
js
|
66881ba458ce7c08999673c2456f1d4bb7398423
|
diff --git a/discord/gateway.py b/discord/gateway.py
index <HASH>..<HASH> 100644
--- a/discord/gateway.py
+++ b/discord/gateway.py
@@ -543,26 +543,14 @@ class DiscordWebSocket:
return
if event == 'READY':
- self._trace = trace = data.get('_trace', [])
self.sequence = msg['s']
self.session_id = data['session_id']
- _log.info(
- 'Shard ID %s has connected to Gateway: %s (Session ID: %s).',
- self.shard_id,
- ', '.join(trace),
- self.session_id,
- )
+ _log.info('Shard ID %s has connected to Gateway (Session ID: %s).', self.shard_id, self.session_id)
elif event == 'RESUMED':
- self._trace = trace = data.get('_trace', [])
# pass back the shard ID to the resumed handler
data['__shard_id__'] = self.shard_id
- _log.info(
- 'Shard ID %s has successfully RESUMED session %s under trace %s.',
- self.shard_id,
- self.session_id,
- ', '.join(trace),
- )
+ _log.info('Shard ID %s has successfully RESUMED session %s.', self.shard_id, self.session_id)
try:
func = self._discord_parsers[event]
|
Remove gateway trace information
This was unused anyway
|
Rapptz_discord.py
|
train
|
py
|
f9b5e1fe3cbb76490d589f9a5144e61dff969825
|
diff --git a/core/src/test/java/org/hibernate/ogm/backendtck/compensation/CompensationSpiTest.java b/core/src/test/java/org/hibernate/ogm/backendtck/compensation/CompensationSpiTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/hibernate/ogm/backendtck/compensation/CompensationSpiTest.java
+++ b/core/src/test/java/org/hibernate/ogm/backendtck/compensation/CompensationSpiTest.java
@@ -478,7 +478,7 @@ public class CompensationSpiTest extends OgmTestCase {
private boolean currentDialectHasFacet(Class<? extends GridDialect> facet) {
GridDialect gridDialect = sfi().getServiceRegistry().getService( GridDialect.class );
- return GridDialects.hasFacet( gridDialect, OptimisticLockingAwareGridDialect.class );
+ return GridDialects.hasFacet( gridDialect, facet );
}
private boolean currentDialectUsesLookupDuplicatePreventionStrategy() {
|
OGM-<I> Testing for passed facet
|
hibernate_hibernate-ogm
|
train
|
java
|
c8335b4380298c3b9a909215276fdaee8d785bd5
|
diff --git a/classes/fields/datetime.php b/classes/fields/datetime.php
index <HASH>..<HASH> 100644
--- a/classes/fields/datetime.php
+++ b/classes/fields/datetime.php
@@ -322,7 +322,8 @@ class PodsField_DateTime extends PodsField {
* @since 2.0
*/
public function pre_save ( $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) {
- $format = $this->format( $options );
+ $format = $this->format( $options, true );
+ $format = static::convert_format( $format, array( 'source' => 'jquery_ui' ) );
if ( ! empty( $value ) && ( 0 == pods_var( static::$type . '_allow_empty', $options, 1 ) || ! in_array( $value, array( '0000-00-00', '0000-00-00 00:00:00', '00:00:00' ) ) ) )
$value = $this->convert_date( $value, static::$storage_format, $format );
|
pre_save() should use the JS format version and convert it to PHP format afterwards
|
pods-framework_pods
|
train
|
php
|
7b67da387a6efd9ed0928a727e61dd52578c1f61
|
diff --git a/lib/rack/cors.rb b/lib/rack/cors.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/cors.rb
+++ b/lib/rack/cors.rb
@@ -129,7 +129,7 @@ module Rack
def process_preflight(env)
return nil if invalid_method_request?(env) || invalid_headers_request?(env)
- to_preflight_headers(env)
+ {'Content-Type' => 'text/plain'}.merge(to_preflight_headers(env))
end
def to_headers(env)
diff --git a/test/cors_test.rb b/test/cors_test.rb
index <HASH>..<HASH> 100644
--- a/test/cors_test.rb
+++ b/test/cors_test.rb
@@ -61,6 +61,12 @@ class CorsTest < Test::Unit::TestCase
assert_preflight_success
assert_equal '*', last_response.headers['Access-Control-Allow-Origin']
end
+
+ should 'return a Content-Type' do
+ preflight_request('http://localhost:3000', '/')
+ assert_preflight_success
+ assert_not_nil last_response.headers['Content-Type']
+ end
end
protected
|
Should return a Content-Type, to comply with the Rack spec
|
cyu_rack-cors
|
train
|
rb,rb
|
ac84ccfdbbd8ace6c66dd36ed88416f145fef2f6
|
diff --git a/mutant/__init__.py b/mutant/__init__.py
index <HASH>..<HASH> 100644
--- a/mutant/__init__.py
+++ b/mutant/__init__.py
@@ -4,7 +4,7 @@ import logging
from django.utils.version import get_version
-VERSION = (0, 2, 2, 'alpha', 0)
+VERSION = (0, 3, 0, 'alpha', 0)
__version__ = get_version(VERSION)
|
Started <I> alpha development.
|
charettes_django-mutant
|
train
|
py
|
fdc05de2124388780924980e6f27bf4483056d18
|
diff --git a/lib/appenders/consoleappender.js b/lib/appenders/consoleappender.js
index <HASH>..<HASH> 100644
--- a/lib/appenders/consoleappender.js
+++ b/lib/appenders/consoleappender.js
@@ -19,6 +19,7 @@ if (typeof define !== 'function') {
define(function (require) {
var Appender = require('../appender');
+ var utils = require('../utils');
/**
* Definition of the Appender class
@@ -67,7 +68,9 @@ define(function (require) {
});
if (message) {
lastMsg = message[message.length-1];
- if (lastMsg && (lastMsg.lastIndexOf('\n') === lastMsg.length - 1)) {
+ if (lastMsg &&
+ utils.isString(lastMsg) &&
+ (lastMsg.lastIndexOf('\n') === lastMsg.length - 1)) {
message[message.length-1] = lastMsg.substring(0, lastMsg.length - 1);
}
}
|
Woodman crashed when message to log to console ended with an object
Same bug as in #<I>: the console appender also expected the final
bit to send to the console to be a string and not to be an object.
However, in browser environments, Woodman typically send objects
as-is to the console.
|
joshfire_woodman
|
train
|
js
|
03045af23cb12a83976fc7fb7ae34511271f1069
|
diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -6355,6 +6355,8 @@
*/
function _sync_cron_method( array $blog_ids, $current_blog_id = null ) {
if ( $this->is_registered() ) {
+ $this->sync_user_beta_mode();
+
if ( $this->has_paid_plan() ) {
// Initiate background plan sync.
$this->_sync_license( true, false, $current_blog_id );
@@ -14157,6 +14159,19 @@
}
/**
+ * @author Leo Fajardo (@leorw)
+ * @since 2.2.4.7
+ */
+ private function sync_user_beta_mode() {
+ $user = $this->get_api_user_scope()->get( '/?plugin_id=' . $this->get_id() . '&fields=is_beta' );
+
+ if ( $this->is_api_result_entity( $user ) ) {
+ $this->_user->is_beta = $user->is_beta;
+ $this->_store_user();
+ }
+ }
+
+ /**
* @author Vova Feldman (@svovaf)
* @since 1.1.7.4
*
|
[beta-list] Included the syncing of user's beta mode in the data sync cron logic.
|
Freemius_wordpress-sdk
|
train
|
php
|
829da6988e3b841d4db799b7596385cfa43f45c1
|
diff --git a/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go b/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go
index <HASH>..<HASH> 100644
--- a/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go
+++ b/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go
@@ -223,7 +223,7 @@ func apiServerHealthz(hostname string, port int) (state.State, error) {
return nil
}
- err = retry.Local(check, 5*time.Second)
+ err = retry.Local(check, 10*time.Second)
// Don't propagate 'Stopped' upwards as an error message, as clients may interpret the err
// as an inability to get status. We need it for retry.Local, however.
|
try to increase api healthz wait timeout
|
kubernetes_minikube
|
train
|
go
|
99f3e95593bdc405803f5fccd586ce08ae1d9030
|
diff --git a/news-bundle/src/Resources/contao/dca/tl_news.php b/news-bundle/src/Resources/contao/dca/tl_news.php
index <HASH>..<HASH> 100644
--- a/news-bundle/src/Resources/contao/dca/tl_news.php
+++ b/news-bundle/src/Resources/contao/dca/tl_news.php
@@ -602,7 +602,7 @@ class tl_news extends Backend
return '
<div class="cte_type ' . $key . '"><strong>' . $arrRow['headline'] . '</strong> - ' . $date . '</div>
-<div class="limit_height' . (!$GLOBALS['TL_CONFIG']['doNotCollapse'] ? ' h64' : '') . ' block">
+<div class="limit_height' . (!$GLOBALS['TL_CONFIG']['doNotCollapse'] ? ' h64' : '') . '">
' . (($arrRow['text'] != '') ? $arrRow['text'] : $arrRow['teaser']) . '
</div>' . "\n";
}
|
[News] Added a "chosen" widget to the templates editor (see #<I>)
|
contao_contao
|
train
|
php
|
d24aa5b0c6d47a53fa63eeee43a893c3c790aaf0
|
diff --git a/easybatch-core/src/test/java/org/easybatch/core/CoreTestsSuite.java b/easybatch-core/src/test/java/org/easybatch/core/CoreTestsSuite.java
index <HASH>..<HASH> 100755
--- a/easybatch-core/src/test/java/org/easybatch/core/CoreTestsSuite.java
+++ b/easybatch-core/src/test/java/org/easybatch/core/CoreTestsSuite.java
@@ -30,8 +30,7 @@ import org.easybatch.core.impl.EngineTest;
import org.easybatch.core.mapper.converter.*;
import org.easybatch.core.filter.*;
import org.easybatch.core.mapper.ObjectMapperTest;
-import org.easybatch.core.reader.FileRecordReaderTest;
-import org.easybatch.core.reader.ListRecordReaderTest;
+import org.easybatch.core.reader.*;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -45,6 +44,9 @@ import org.junit.runners.Suite;
// reader
FileRecordReaderTest.class,
ListRecordReaderTest.class,
+ QueueRecordReaderTest.class,
+ StringRecordReaderTest.class,
+ CliRecordReaderTest.class,
// mapper
ObjectMapperTest.class,
AtomicIntegerTypeConverterTest.class,
|
add new tests to the CoreTestsSuite
|
j-easy_easy-batch
|
train
|
java
|
9188ce1bfaa818e278c29494a0db64648ac01415
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@ setup(
name="gdown",
version=version,
packages=find_packages(exclude=["github2pypi"]),
- install_requires=["filelock", "requests[socks]", "six", "tqdm"],
+ install_requires=["filelock", "requests[socks]>=2.12.0", "six", "tqdm"],
description="Google Drive direct download of big files.",
long_description=get_long_description(),
long_description_content_type="text/markdown",
|
Set requests version to <I> or higher.
|
wkentaro_gdown
|
train
|
py
|
07cd5431885568c554ec1603bf60c069e0f6a2e3
|
diff --git a/core/src/main/java/org/cache2k/impl/threading/LimitedPooledExecutor.java b/core/src/main/java/org/cache2k/impl/threading/LimitedPooledExecutor.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/cache2k/impl/threading/LimitedPooledExecutor.java
+++ b/core/src/main/java/org/cache2k/impl/threading/LimitedPooledExecutor.java
@@ -369,7 +369,7 @@ public class LimitedPooledExecutor implements ExecutorService {
* This may have adverse effects, e.g. if a storage on hard disk is
* starting to many requests in parallel. See outer class documentation.
*/
- public int maxThreadCount = Runtime.getRuntime().availableProcessors() - 1;
+ public int maxThreadCount = Runtime.getRuntime().availableProcessors();
/**
* Enables yet untested code. Default false.
|
Fix LimitedPooledExecutor on single processor machine
|
cache2k_cache2k
|
train
|
java
|
15706c0d001f331604caed07a9686a46bff667bb
|
diff --git a/bin/cli.js b/bin/cli.js
index <HASH>..<HASH> 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -13,9 +13,9 @@ var cliPkg = require('../package');
function exit(text) {
if (text instanceof Error) {
- chalk.red(console.error(text.stack));
+ console.error(chalk.red(text.stack));
} else {
- chalk.red(console.error(text));
+ console.error(chalk.red(text));
}
process.exit(1);
}
@@ -186,7 +186,8 @@ function invoke(env) {
commander.parse(process.argv);
Promise.resolve(pending).then(function() {
- commander.help();
+ commander.outputHelp();
+ exit('Unknown command-line options, exiting');
});
}
|
<I> CLI sets exit-code 1 if the command supplied was not parseable (#<I>)
* CLI Sets exit code to 1 if the command wasn't parseable
* Fix color output for errors in the cli
|
tgriesser_knex
|
train
|
js
|
06415467a34ab37e7504cde5074bf74d66dc1899
|
diff --git a/grab/grab.py b/grab/grab.py
index <HASH>..<HASH> 100644
--- a/grab/grab.py
+++ b/grab/grab.py
@@ -174,6 +174,7 @@ class Grab(object):
self.reset()
if kwargs:
self.setup(**kwargs)
+ self.clone_counter = 0
def reset(self):
"""
@@ -214,6 +215,7 @@ class Grab(object):
g.response = deepcopy(self.response)
for key in self.clonable_attributes:
setattr(g, key, getattr(self, key))
+ g.clone_counter = self.clone_counter + 1
return g
def setup(self, **kwargs):
|
New attribute: clone_counter
|
lorien_grab
|
train
|
py
|
99f923175903cdb7e8425d3a01d20557b75f5526
|
diff --git a/salt/grains/fx2.py b/salt/grains/fx2.py
index <HASH>..<HASH> 100644
--- a/salt/grains/fx2.py
+++ b/salt/grains/fx2.py
@@ -24,11 +24,8 @@ GRAINS_CACHE = {}
def __virtual__():
- try:
- if salt.utils.platform.is_proxy() and __opts__['proxy']['proxytype'] == 'fx2':
- return __virtualname__
- except KeyError:
- pass
+ if salt.utils.platform.is_proxy() and 'proxy' in __opts__ and __opts__['proxy'].get('proxytype') == 'fx2':
+ return __virtualname__
return False
diff --git a/salt/grains/marathon.py b/salt/grains/marathon.py
index <HASH>..<HASH> 100644
--- a/salt/grains/marathon.py
+++ b/salt/grains/marathon.py
@@ -14,10 +14,9 @@ __virtualname__ = 'marathon'
def __virtual__():
- if not salt.utils.platform.is_proxy() or 'proxy' not in __opts__:
- return False
- else:
+ if salt.utils.platform.is_proxy() and 'proxy' in __opts__ and __opts__['proxy'].get('proxytype') == 'marathon':
return __virtualname__
+ return False
def kernel():
|
fix proxy virtual checks for marathon and fx2
|
saltstack_salt
|
train
|
py,py
|
d231295cda3012219d16555c3ce8732600940d47
|
diff --git a/lib/core/seleniumRunner.js b/lib/core/seleniumRunner.js
index <HASH>..<HASH> 100644
--- a/lib/core/seleniumRunner.js
+++ b/lib/core/seleniumRunner.js
@@ -33,7 +33,7 @@ class SeleniumRunner {
this.driver = driver;
}))
.timeout(this.options.timeouts.browserStart,
- new Error(util.format('Failed to start browser in %d seconds.',
+ new UrlLoadError(util.format('Failed to start browser in %d seconds.',
this.options.timeouts.browserStart / 1000)));
}
|
always throw UrlLoadError for errors
|
sitespeedio_browsertime
|
train
|
js
|
61ddafdab2c9ac3c762802cbf4f2e74c72e5e4a1
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -1,10 +1,14 @@
/**
* Created by XadillaX on 2014/8/5.
*/
-require("sugar");
+var _ = {
+ uniq: require("lodash.uniq")
+};
var escapist = require("node-escapist");
var CharBuffer = require("char-buffer");
+var AND_SHARP = /&#([x|X]{1}[\d|a-f|A-F]+?|\d+?);/g;
+
/**
* escape html
* @param html
@@ -24,8 +28,7 @@ exports.unescape = function(html) {
// with `�` or `ꯍ`
// (thanks to mcdong)
- var andSharp = /&#([x|X]{1}[\d|a-f|A-F]+?|\d+?);/g;
- var result = temp.match(andSharp);
+ var result = temp.match(AND_SHARP);
// no match
if(!Array.isArray(result)) {
@@ -33,7 +36,7 @@ exports.unescape = function(html) {
}
// reduce
- temp = result.unique().reduce(function(html, code) {
+ temp = _.uniq(result).reduce(function(html, code) {
var buffer = new CharBuffer();
var charCode = (code[2].toUpperCase() === 'X') ?
|
feat: use lodash to instead of sugar
|
XadillaX_true-html-escape
|
train
|
js
|
9000896ed770f57ccb39344a51237a48171d1ee0
|
diff --git a/lib/restclient.rb b/lib/restclient.rb
index <HASH>..<HASH> 100644
--- a/lib/restclient.rb
+++ b/lib/restclient.rb
@@ -107,7 +107,7 @@ module RestClient
# @return [Boolean]
#
def self.proxy_set?
- !!(@proxy_set ||= false)
+ @proxy_set ||= false
end
# Setup the log for RestClient calls.
|
Get rid of !! since it's not really adding value.
|
rest-client_rest-client
|
train
|
rb
|
2f11628be29b9f5bacc3f86e4728e9102868ecfa
|
diff --git a/src/update.js b/src/update.js
index <HASH>..<HASH> 100644
--- a/src/update.js
+++ b/src/update.js
@@ -91,6 +91,9 @@ update.updatePo = function(poData, potData) {
po.translations[""][msgid] = pot.translations[""][msgid];
}
else {
+ if (!po.translations[""][msgid].comments) {
+ po.translations[""][msgid].comments = {};
+ }
po.translations[""][msgid].comments.reference = pot.translations[""][msgid].comments.reference;
}
}
|
Avoid crash if the merged po file does not contain references
|
flozz_stonejs-tools
|
train
|
js
|
a75ec362067ccd7252beb2701fbc8500c168a195
|
diff --git a/leaflet.markercluster.layersupport-src.js b/leaflet.markercluster.layersupport-src.js
index <HASH>..<HASH> 100644
--- a/leaflet.markercluster.layersupport-src.js
+++ b/leaflet.markercluster.layersupport-src.js
@@ -487,9 +487,7 @@
layer = this._layers[layer];
}
- if ('off' in layer) {
- layer.off(EVENTS, this._propagateEvent, this);
- }
+ layer.removeEventParent(this);
var id = L.stamp(layer);
|
Fix #6
due to missing event migration from Leaflet <I> to <I>
|
ghybs_Leaflet.MarkerCluster.LayerSupport
|
train
|
js
|
a7b0d68feffc32f6681e5d94bded6173fe6e09e1
|
diff --git a/lib/DSL.js b/lib/DSL.js
index <HASH>..<HASH> 100644
--- a/lib/DSL.js
+++ b/lib/DSL.js
@@ -41,7 +41,7 @@ class Parser {
}
cb(null, {
globals: global_scope,
- success: true
+ success: self.interpreter.success
});
});
});
@@ -56,7 +56,7 @@ class Parser {
}
cb(null, {
globals: global_scope,
- success: true
+ success: self.interpreter.success
});
});
}
|
Report on success, don't clobber interpreter value.
|
dapphub_dapple
|
train
|
js
|
25ea02fff07e9be2c6a1e7cd04db58d44f8000d4
|
diff --git a/dna.js b/dna.js
index <HASH>..<HASH> 100755
--- a/dna.js
+++ b/dna.js
@@ -29,14 +29,16 @@ dna.util = {
call: function(func, param) { //calls func (string name or actual function) passing in param
// Example: dna.util.call('app.cart.buy', 7); ==> app.cart.buy(7);
function contextCall(obj, names) {
- if (!obj)
- dna.core.berserk('Invalid name before "' + names[0] + '" in: ' + func);
+ if (!obj || (names.length == 1 && typeof obj[names[0]] !== 'function'))
+ dna.core.berserk('Callback function not found: ' + func);
else if (names.length == 1)
obj[names[0]](param); //'app.cart.buy' -> window['app']['cart']['buy'](param);
else
contextCall(obj[names[0]], names.slice(1));
}
- if (typeof(func) === 'string')
+ if (func === '' || $.inArray(typeof func, ['number', 'boolean']) !== -1)
+ dna.core.berserk('Invalid callback function: ' + func);
+ else if (typeof(func) === 'string' && func.lenght > 0)
contextCall(window, func.split('.'));
else if (func instanceof Function)
func(param);
|
Additional validation for func param in dna.util.call()
|
dnajs_dna.js
|
train
|
js
|
27a4f3c0d7ad294966c3a4e567535c8c3c0aeb7f
|
diff --git a/cake/tests/cases/console/console_output.test.php b/cake/tests/cases/console/console_output.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/console/console_output.test.php
+++ b/cake/tests/cases/console/console_output.test.php
@@ -134,6 +134,18 @@ class ConsoleOutputTest extends CakeTestCase {
}
/**
+ * test that formatting doesn't eat tags it doesn't know about.
+ *
+ * @return void
+ */
+ function testFormattingNotEatingTags() {
+ $this->output->expects($this->once())->method('_write')
+ ->with("<red> Something bad");
+
+ $this->output->write('<red> Something bad', false);
+ }
+
+/**
* test formatting with custom styles.
*
* @return void
|
Adding test to make sure tags that are unknown are not removed.
|
cakephp_cakephp
|
train
|
php
|
695d9f08526af9eed8a22976b4aaec48cdbac21e
|
diff --git a/lib/jsonapi/request.rb b/lib/jsonapi/request.rb
index <HASH>..<HASH> 100644
--- a/lib/jsonapi/request.rb
+++ b/lib/jsonapi/request.rb
@@ -281,7 +281,7 @@ module JSONAPI
# Since we do not yet support polymorphic associations we will raise an error if the type does not match the
# association's type.
# ToDo: Support Polymorphic associations
- if links_object[:type] && (links_object[:type] != format_key(association.type).to_s)
+ if links_object[:type] && (links_object[:type] != association.type.to_s)
raise JSONAPI::Exceptions::TypeMismatch.new(links_object[:type])
end
|
Removed errant type key re-formatting in parse_params
|
cerebris_jsonapi-resources
|
train
|
rb
|
cb6320aa8de4f190f9530aa97e73c3ad089d7b22
|
diff --git a/src/main/java/com/auth0/net/CustomRequest.java b/src/main/java/com/auth0/net/CustomRequest.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/auth0/net/CustomRequest.java
+++ b/src/main/java/com/auth0/net/CustomRequest.java
@@ -100,12 +100,11 @@ public class CustomRequest<T> extends BaseRequest<T> implements CustomizableRequ
}
protected Auth0Exception createResponseException(Response response) {
- if (response.code() == STATUS_CODE_TOO_MANY_REQUEST) {
- return createRateLimitException(response);
- }
-
String payload = null;
try (ResponseBody body = response.body()) {
+ if (response.code() == STATUS_CODE_TOO_MANY_REQUEST) {
+ return createRateLimitException(response);
+ }
payload = body.string();
MapType mapType = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class);
Map<String, Object> values = mapper.readValue(payload, mapType);
|
Closing response body on RateLimitException
|
auth0_auth0-java
|
train
|
java
|
27f7d7e170b269810fc0846e36c6ae60691509fa
|
diff --git a/app/controllers/patient_event_types_controller.rb b/app/controllers/patient_event_types_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/patient_event_types_controller.rb
+++ b/app/controllers/patient_event_types_controller.rb
@@ -31,13 +31,11 @@ class PatientEventTypesController < ApplicationController
end
def destroy
- @patient_event_type = PatientEventType.find(params[:id])
- @patient_event_type.soft_delete!
+ PatientEventType.destroy(params[:id])
redirect_to patient_event_types_path, :notice => "You have successfully removed a patient event type."
- end
+ end
def allowed_params
params.require(:patient_event_type).permit(:name, :deleted_at)
- end
-
+ end
end
diff --git a/app/models/patient_event_type.rb b/app/models/patient_event_type.rb
index <HASH>..<HASH> 100644
--- a/app/models/patient_event_type.rb
+++ b/app/models/patient_event_type.rb
@@ -1,5 +1,5 @@
class PatientEventType < ActiveRecord::Base
- include Concerns::SoftDelete
+ acts_as_paranoid
has_many :patient_event
|
Remove SoftDelete from PatientEventType
|
airslie_renalware-core
|
train
|
rb,rb
|
6d5814ba652df963d52dc9265524f84215a6a0fc
|
diff --git a/cluster/calcium/lambda.go b/cluster/calcium/lambda.go
index <HASH>..<HASH> 100644
--- a/cluster/calcium/lambda.go
+++ b/cluster/calcium/lambda.go
@@ -36,7 +36,7 @@ func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, inC
return nil, errors.WithStack(types.ErrRunAndWaitCountOneWithStdin)
}
- commit, err := c.walCreateLambda(ctx, opts)
+ commit, err := c.walCreateLambda(opts)
if err != nil {
return nil, logger.Err(err)
}
@@ -134,7 +134,7 @@ func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, inC
return runMsgCh, nil
}
-func (c *Calcium) walCreateLambda(ctx context.Context, opts *types.DeployOptions) (wal.Commit, error) {
+func (c *Calcium) walCreateLambda(opts *types.DeployOptions) (wal.Commit, error) {
uid, err := uuid.NewRandom()
if err != nil {
return nil, errors.WithStack(err)
|
fix: make golint works (#<I>)
|
projecteru2_core
|
train
|
go
|
99f8d2770cab429c23bb06542f5f6dace4de6eb9
|
diff --git a/polyfills/Promise/prototype/finally/polyfill.js b/polyfills/Promise/prototype/finally/polyfill.js
index <HASH>..<HASH> 100644
--- a/polyfills/Promise/prototype/finally/polyfill.js
+++ b/polyfills/Promise/prototype/finally/polyfill.js
@@ -52,7 +52,7 @@
// 1.2 If IsPromise(promise) is false, throw a TypeError exception.
// N.B. IsPromise is called within Promise.prototype.then (25.4.5.3)
var newPromise = then(
- this, // throws if IsPromise(this) is not true
+ promise, // throws if IsPromise(promise) is not true
function (x) {
return then(getPromise(C, handler), function () {
return x;
@@ -66,7 +66,7 @@
);
// 1.3 Let C be ? SpeciesConstructor(promise, %Promise%).
- var C = speciesConstructor(this, Promise); // throws if SpeciesConstructor throws
+ var C = speciesConstructor(promise, Promise); // throws if SpeciesConstructor throws
// 1.4 Let resultCapablity be ? NewPromiseCapablity(C).
// 1.5 Return PerformPromiseFinally(promise, onFinaaly, resultCapability).
|
use variable according to spec (#<I>)
|
Financial-Times_polyfill-service
|
train
|
js
|
1ddcbf416cbdfe0829a6fa01b8469c939d1f4095
|
diff --git a/src/mako/syringe/Container.php b/src/mako/syringe/Container.php
index <HASH>..<HASH> 100644
--- a/src/mako/syringe/Container.php
+++ b/src/mako/syringe/Container.php
@@ -436,7 +436,7 @@ class Container
* @access public
* @param callable $callable Callable
* @param array $parameters (optional) Parameters
- * @return mixed
+ * @return object
*/
public function call(callable $callable, array $parameters = [])
|
Changed return type from mixed to object
|
mako-framework_framework
|
train
|
php
|
89aac882c3c04dc4f87788b00dace79218029a71
|
diff --git a/src/Input.js b/src/Input.js
index <HASH>..<HASH> 100644
--- a/src/Input.js
+++ b/src/Input.js
@@ -78,7 +78,9 @@ class Input extends Base {
// check, but here we need to do it to preserve selection in Safari.
const base = super.updates;
const value = this.state.innerProperties.value;
- if (this.$.inner.value === value && base.$.inner.value === value) {
+ /** @type {any} */
+ const cast = this.$.inner;
+ if (cast.value === value && base.$.inner.value === value) {
delete base.$.inner.value;
}
return merge(base, {
@@ -91,6 +93,7 @@ class Input extends Base {
// Updating the value can also update the selectionStart and selectionEnd
// properties, so we have to update our state to match.
get value() {
+ // @ts-ignore
return super.value;
}
set value(value) {
|
Fix lint warnings.
|
elix_elix
|
train
|
js
|
a97f3cccb91fad488a010b893ecf169e135c5b0e
|
diff --git a/crochet/_version.py b/crochet/_version.py
index <HASH>..<HASH> 100644
--- a/crochet/_version.py
+++ b/crochet/_version.py
@@ -2,4 +2,4 @@
Store version in its own module so we can access it from both setup.py and
__init__.
"""
-__version__ = "0.9.0"
+__version__ = "1.0.0"
|
Change version to <I>.
|
itamarst_crochet
|
train
|
py
|
9cefb39747041ddd09305dba08edebe01133ad68
|
diff --git a/shared/actions/login.js b/shared/actions/login.js
index <HASH>..<HASH> 100644
--- a/shared/actions/login.js
+++ b/shared/actions/login.js
@@ -152,6 +152,11 @@ function* navBasedOnLoginAndInitialState(): Saga.SagaGenerator<any, any> {
yield Saga.put(switchRouteDef(loginRouteTree))
yield Saga.put.resolve(getExtendedStatus())
yield Saga.call(getAccounts)
+ // We may have logged successfully in by now, check before trying to navigate
+ const state = yield Saga.select()
+ if (state.config.loggedIn) {
+ return
+ }
yield Saga.put(navigateTo(['login'], [loginTab]))
} else if (loginError) {
// show error on login screen
|
add check for race in login flow (#<I>)
|
keybase_client
|
train
|
js
|
15aa3404b2a5c9869259ac338b246462ff58031e
|
diff --git a/lib/helpers/utils.js b/lib/helpers/utils.js
index <HASH>..<HASH> 100644
--- a/lib/helpers/utils.js
+++ b/lib/helpers/utils.js
@@ -27,3 +27,9 @@ module.exports.pushIfNotExist = function (type, array, value) {
return array;
};
+
+module.exports.timeoutPromise = (timer) => {
+ return new Promise((resolve) => {
+ setTimeout(resolve, timer);
+ });
+};
diff --git a/lib/producer.js b/lib/producer.js
index <HASH>..<HASH> 100644
--- a/lib/producer.js
+++ b/lib/producer.js
@@ -132,7 +132,10 @@ var produce = function(queue, msg, options) {
})
.catch(function (err) {
Logger.error('[BMQ-PRODUCER]', err);
- return produce(queue, msg, options);
+ return utils.timeoutPromise(1000)
+ .then(() => {
+ return produce(queue, msg, options);
+ });
});
};
|
Add a timer on messages to not overflow CPU when connection is lost
|
dial-once_node-bunnymq
|
train
|
js,js
|
d4c9aaaa2ec195a6ba7ad72c8532de64b6560a8a
|
diff --git a/Auth/OpenID/Discover.php b/Auth/OpenID/Discover.php
index <HASH>..<HASH> 100644
--- a/Auth/OpenID/Discover.php
+++ b/Auth/OpenID/Discover.php
@@ -377,7 +377,8 @@ function Auth_OpenID_discoverURI($uri, &$fetcher)
{
$parsed = parse_url($uri);
- if ($parsed && $parsed['scheme'] && $parsed['host']) {
+ if ($parsed && isset($parsed['scheme']) &&
+ isset($parsed['host'])) {
if (!in_array($parsed['scheme'], array('http', 'https'))) {
// raise DiscoveryFailure('URI scheme is not HTTP or HTTPS', None)
return array($uri, array());
|
[project @ isset() to silence notices]
|
openid_php-openid
|
train
|
php
|
e02afd98068224573814b042c4c85d2d7e08aca6
|
diff --git a/lib/ace/Document.js b/lib/ace/Document.js
index <HASH>..<HASH> 100644
--- a/lib/ace/Document.js
+++ b/lib/ace/Document.js
@@ -25,7 +25,7 @@ var Document = function(text, mode) {
if (mode) {
this.setMode(mode);
}
-
+
if (lang.isArray(text)) {
this.$insertLines(0, text);
} else {
diff --git a/lib/ace/Editor.js b/lib/ace/Editor.js
index <HASH>..<HASH> 100644
--- a/lib/ace/Editor.js
+++ b/lib/ace/Editor.js
@@ -423,7 +423,7 @@ var Editor = function(renderer, doc) {
else
break;
console.log("Indent " + indent + "(" + line.length + ")");
- if (line.length != 0)
+ if (/[^\s]$/.test(line))
minIndent = Math.min(indent, minIndent);
}
console.log("min indent " + minIndent);
|
Small fix in audo-indentation.
|
joewalker_gcli
|
train
|
js,js
|
d63d26573d1faaec24f1c4676d490f07f1df4944
|
diff --git a/Event.php b/Event.php
index <HASH>..<HASH> 100644
--- a/Event.php
+++ b/Event.php
@@ -154,7 +154,7 @@ class Event
{
return EVENT::ISSUE;
}
- elseif ($json['object_kind'] == 'merge_request' && $json['object_attributes']['state'] == 'merged')
+ elseif ($json['object_kind'] == 'merge_request' && $json['object_attributes']['action'] == 'merge')
{
return EVENT::MERGE;
}
|
Fix a bug : all update of MRs after merging were considered as merge action
|
Zoddo_gitlab-webhook
|
train
|
php
|
9a3e067e0bc08e5ff3dfc115a2e533f10d5aafd4
|
diff --git a/src/questionPanel.js b/src/questionPanel.js
index <HASH>..<HASH> 100644
--- a/src/questionPanel.js
+++ b/src/questionPanel.js
@@ -1,5 +1,6 @@
-var React = require('react');
-var _ = require('lodash');
+var React = require('react');
+var _ = require('lodash');
+var KeyCodez = require('keycodez');
var Validation = require('./lib/validation');
var ErrorMessages = require('./lib/errors');
@@ -150,7 +151,10 @@ class QuestionPanel extends React.Component {
}
handleInputKeyDown(e) {
-
+ if (KeyCodez[e.keyCode] === 'enter') {
+ e.preventDefault();
+ this.handleMainButtonClick.call(this);
+ }
}
render() {
|
On enter key - Stop the form from submitting and run the handleMainButtonClick method - fixes #8
|
andrewhathaway_Winterfell
|
train
|
js
|
a8f357d65859d0afaf2b8469400ae0f0e7285cc7
|
diff --git a/Neos.Flow/Classes/Command/CacheCommandController.php b/Neos.Flow/Classes/Command/CacheCommandController.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/Command/CacheCommandController.php
+++ b/Neos.Flow/Classes/Command/CacheCommandController.php
@@ -450,7 +450,6 @@ class CacheCommandController extends CommandController
$this->outputLine('<success>Completed</success>', [$identifier]);
}
}
-
}
/**
|
[TASK] Remove newline to satisfy PSR-2
|
neos_flow-development-collection
|
train
|
php
|
845d3e2dbab101d254c7babd34e1de58aba2ffb3
|
diff --git a/molgenis-data/src/main/java/org/molgenis/data/annotation/RepositoryAnnotator.java b/molgenis-data/src/main/java/org/molgenis/data/annotation/RepositoryAnnotator.java
index <HASH>..<HASH> 100644
--- a/molgenis-data/src/main/java/org/molgenis/data/annotation/RepositoryAnnotator.java
+++ b/molgenis-data/src/main/java/org/molgenis/data/annotation/RepositoryAnnotator.java
@@ -42,13 +42,4 @@ public interface RepositoryAnnotator
* @return name
*/
String getName();
-
- /**
- * Checks if folder and files that were set with a runtime property actually exist, or if a webservice can be
- * reached
- *
- * @return annotationDataExists
- * */
- boolean annotationDataExists();
-
}
|
Removed annotationDataExists from the interface
|
molgenis_molgenis
|
train
|
java
|
fcb1cecada40f78b65109fded0f72e317d18b68a
|
diff --git a/numina/array/wavecal/arccalibration.py b/numina/array/wavecal/arccalibration.py
index <HASH>..<HASH> 100644
--- a/numina/array/wavecal/arccalibration.py
+++ b/numina/array/wavecal/arccalibration.py
@@ -599,7 +599,7 @@ def arccalibration_direct(wv_master,
# each triplet from the master list provides a potential solution
# for CRVAL1 and CDELT1
- for j_loc in range(j_loc_min, j_loc_max):
+ for j_loc in range(j_loc_min, j_loc_max+1):
j1, j2, j3 = triplets_master_sorted_list[j_loc]
# initial solutions for CDELT1, CRVAL1 and CRVALN
cdelt1_temp = (wv_master[j3]-wv_master[j1])/dist13
|
Correcting missing <I> in loop
|
guaix-ucm_numina
|
train
|
py
|
c727bb6739844f701bdc6ee585708eba60d77cf5
|
diff --git a/src/autotyper.js b/src/autotyper.js
index <HASH>..<HASH> 100644
--- a/src/autotyper.js
+++ b/src/autotyper.js
@@ -174,7 +174,7 @@ const autotyper = {
this.letterTotal = this.settings.text.length;
this.letterCount = 0;
- this.emit(LOOP_EVENT);
+ this.emit(LOOP_EVENT, this.loopCount);
return this;
},
|
feat: pass `loopCount` on emitting `LOOP_EVENT`
|
saulhardman_autotyper
|
train
|
js
|
afc17bf44b9a90806d3b41ab227861608fd5a6a9
|
diff --git a/lib/AmazonSNS.php b/lib/AmazonSNS.php
index <HASH>..<HASH> 100644
--- a/lib/AmazonSNS.php
+++ b/lib/AmazonSNS.php
@@ -246,7 +246,13 @@ class AmazonSNS {
// Get subscriptions
$subs = $resultXml->ListSubscriptionsResult->Subscriptions->member;
- return $this->_processXmlToArray($subs);
+ $return = ['members' => $this->_processXmlToArray($subs)];
+
+ if(isset($resultXml->ListSubscriptionsResult->NextToken)) {
+ $return['nextToken'] = strval($resultXml->ListSubscriptionsResult->NextToken);
+ }
+
+ return $return;
}
/**
@@ -276,7 +282,13 @@ class AmazonSNS {
// Get subscriptions
$subs = $resultXml->ListSubscriptionsByTopicResult->Subscriptions->member;
- return $this->_processXmlToArray($subs);
+ $return = ['members' => $this->_processXmlToArray($subs)];
+
+ if(isset($resultXml->ListSubscriptionsByTopicResult->NextToken)) {
+ $return['nextToken'] = strval($resultXml->ListSubscriptionsByTopicResult->NextToken);
+ }
+
+ return $return;
}
/**
|
Return subscriptions as 'members' and return 'nextToken' if there is one in subscription list methods - #<I>
|
chrisbarr_AmazonSNS-PHP-API
|
train
|
php
|
341bfa83335b6f5fddcc36eb4f578950f0f9493d
|
diff --git a/lib/modem.js b/lib/modem.js
index <HASH>..<HASH> 100644
--- a/lib/modem.js
+++ b/lib/modem.js
@@ -147,6 +147,8 @@ Modem.prototype.dial = function(options, callback) {
optionsf.headers['Content-Length'] = Buffer.byteLength(data);
} else if (Buffer.isBuffer(data) === true) {
optionsf.headers['Content-Length'] = data.length;
+ } else {
+ optionsf.headers['Transfer-Encoding'] = 'chunked';
}
if (options.hijack) {
|
Making modem work better when using a stream
When using a stream with docker modem there is no header 'Content-Length' since there is no known length to it. The right replacement for that is using the header 'Transfer-Encoding: chunked'.
This can cause problem with docker daemon as an example: when building an image and canceling (by exiting process or destroying connection) omitting this header while using a stream cause the daemon to ignore the dropped connection and continue the build.
|
apocas_docker-modem
|
train
|
js
|
1140d31d9baabfc8037ad243a311fe9d6f9f23a8
|
diff --git a/pkg/kubelet/kubelet_pods.go b/pkg/kubelet/kubelet_pods.go
index <HASH>..<HASH> 100644
--- a/pkg/kubelet/kubelet_pods.go
+++ b/pkg/kubelet/kubelet_pods.go
@@ -1357,7 +1357,7 @@ func (kl *Kubelet) GetAttach(podFullName string, podUID types.UID, containerName
// since whether the process is running in a TTY cannot be changed after it has started. We
// need the api.Pod to get the TTY status.
pod, found := kl.GetPodByFullName(podFullName)
- if !found || pod.UID != podUID {
+ if !found || (string(podUID) != "" && pod.UID != podUID) {
return nil, fmt.Errorf("pod %s not found", podFullName)
}
containerSpec := kubecontainer.GetContainerSpec(pod, containerName)
|
Kubelet: only check podUID when it is actually set
|
kubernetes_kubernetes
|
train
|
go
|
2297165cf2994efe6875ea98e2977231f953cea4
|
diff --git a/rootpy/plotting/canvas.py b/rootpy/plotting/canvas.py
index <HASH>..<HASH> 100644
--- a/rootpy/plotting/canvas.py
+++ b/rootpy/plotting/canvas.py
@@ -44,7 +44,8 @@ class Canvas(_PadBase, QROOT.TCanvas):
def __init__(self,
width=None, height=None,
x=None, y=None,
- name=None, title=None):
+ name=None, title=None,
+ size_includes_decorations=False):
# The following line will trigger finalSetup and start the graphics
# thread if not started already
@@ -61,4 +62,12 @@ class Canvas(_PadBase, QROOT.TCanvas):
ROOT.kTRUE
super(Canvas, self).__init__(x, y, width, height,
name=name, title=title)
+ if not size_includes_decorations:
+ # Canvas dimensions include the window manager's decorations by
+ # default in vanilla ROOT. I think this is a bad default.
+ # Since in the most common case I don't care about the window
+ # decorations, the default will be to set the dimensions of the
+ # paintable area of the canvas.
+ self.SetWindowSize(width + (width - self.GetWw()),
+ height + (height - self.GetWh()))
self._post_init()
|
don't include canvas window manager decorations in canvas size by default
|
rootpy_rootpy
|
train
|
py
|
72c67aedd82fcb8b898c48a07c1bed418bbf8022
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ requirements = [
'invenio-documents>=0.1.0.post2',
'invenio-ext>=0.2.1',
'invenio-records>=0.2.1',
- 'invenio-utils>=0.1.0',
+ 'invenio-utils>=0.1.1',
]
test_requirements = [
|
installation: inveni-utils>=<I>
|
inveniosoftware_invenio-previewer
|
train
|
py
|
efb0ba176549bb19e25882866fd246ac68647575
|
diff --git a/lib/cancan/matchers.rb b/lib/cancan/matchers.rb
index <HASH>..<HASH> 100644
--- a/lib/cancan/matchers.rb
+++ b/lib/cancan/matchers.rb
@@ -4,8 +4,7 @@ if rspec_module == 'RSpec'
require 'rspec/core'
require 'rspec/expectations'
else
- ActiveSupport::Deprecation
- .warn('RSpec < 3 will not be supported in the CanCanCan >= 2.0.0')
+ ActiveSupport::Deprecation.warn('RSpec < 3 will not be supported in the CanCanCan >= 2.0.0')
end
Kernel.const_get(rspec_module)::Matchers.define :be_able_to do |*args|
|
Fix a errant newline during conflict merge.
|
CanCanCommunity_cancancan
|
train
|
rb
|
3ac0f32824d65e8335354da8e6ff3e89f8652cfe
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -15,13 +15,13 @@ function writefile(pair, type) {
module.exports = postcss.plugin('postcss-classname', function (opts) {
opts = opts || {};
var dist = opts.dist || ".",
- outputName = opts.outputName || "style",
- type = opts.type || ".js",
- hashType = opts.hashType || "md5",
- digestType = opts.digestType || "base32",
- classnameFormat = opts.classnameFormat || "[classname]-[hash]",
- maxLength = opts.maxLength || 6,
- outputFile;
+ outputName = opts.outputName || "style",
+ type = opts.type || ".js",
+ hashType = opts.hashType || "md5",
+ digestType = opts.digestType || "base32",
+ classnameFormat = opts.classnameFormat || "[classname]-[hash]",
+ maxLength = opts.maxLength || 6,
+ outputFile;
if (type[0] !== '.')
type = '.' + type;
|
Fixing changes to spacing done by my editor
|
ctxhou_postcss-hash-classname
|
train
|
js
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.