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 |
|---|---|---|---|---|---|
5f9d86310c703579ac82060bbe33cfd1a67682ab | diff --git a/smoke-test.py b/smoke-test.py
index <HASH>..<HASH> 100755
--- a/smoke-test.py
+++ b/smoke-test.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
-from ..omxplayer import OMXPlayer
+from omxplayer import OMXPlayer
from time import sleep
vid = OMXPlayer('../chocolate-adventure/media/temple.mkv') | Fix import in smoke-test.py | willprice_python-omxplayer-wrapper | train | py |
1e453c132b87a82c37ff902b654ba19bf182107a | diff --git a/lib/View/CRUD.php b/lib/View/CRUD.php
index <HASH>..<HASH> 100644
--- a/lib/View/CRUD.php
+++ b/lib/View/CRUD.php
@@ -258,6 +258,8 @@ class View_CRUD extends View
if ($this->configureAdd($fields)) {
return $model;
}
+ } else {
+ $this->add_button->destroy();
}
if ($this->allow_edit) { | Destroy add_button if you're not allowed to add records | atk4_atk4 | train | php |
46ce49687e60a053b3c2f4aec21993062e9e5b95 | diff --git a/georaster-layer-for-leaflet.js b/georaster-layer-for-leaflet.js
index <HASH>..<HASH> 100644
--- a/georaster-layer-for-leaflet.js
+++ b/georaster-layer-for-leaflet.js
@@ -144,7 +144,7 @@ var GeoRasterLayer = L.GridLayer.extend({
let tileNwPoint = coords.scaleBy(tileSize);
// render asynchronously so tiles show up as they finish instead of all at once (which blocks the UI)
- setTimeout(async function () {
+ (async function () {
let min_x = Number.MAX_SAFE_INTEGER;
let max_x = 0;
let min_y = Number.MAX_SAFE_INTEGER;
@@ -301,7 +301,7 @@ var GeoRasterLayer = L.GridLayer.extend({
//if (debug_level >= 1) console.groupEnd();
done(error, tile);
- }.bind(this), 0);
+ }.bind(this))();
// return the tile so it can be rendered on screen
return tile; | replace setTimeout with immediately invoked | GeoTIFF_georaster-layer-for-leaflet | train | js |
4d70d552c495db100b941f9b179c2042b07d980c | diff --git a/cwltool/singularity.py b/cwltool/singularity.py
index <HASH>..<HASH> 100644
--- a/cwltool/singularity.py
+++ b/cwltool/singularity.py
@@ -164,7 +164,8 @@ class SingularityCommandLineJob(ContainerCommandLineJob):
cidfile_prefix="", **kwargs):
# type: (MutableMapping[Text, Text], bool, bool, Text, Text, **Any) -> List
- runtime = [u"singularity", u"--quiet", u"exec", u"--contain"]
+ runtime = [u"singularity", u"--quiet", u"exec", u"--contain", u"--pid",
+ u"--ipc", u"--userns"]
runtime.append(u"--bind")
runtime.append(u"{}:{}:rw".format(
docker_windows_path_adjust(os.path.realpath(self.outdir)),
@@ -182,7 +183,9 @@ class SingularityCommandLineJob(ContainerCommandLineJob):
if kwargs.get("custom_net", None) is not None:
raise UnsupportedRequirement(
- "Singularity implementation does not support networking")
+ "Singularity implementation does not support custom networking")
+ elif kwargs.get("disable_net", None):
+ runtime.append(u"--net")
env["SINGULARITYENV_TMPDIR"] = "/tmp"
env["SINGULARITYENV_HOME"] = self.builder.outdir | Further lock down of Singularity
as inspired by <URL> | common-workflow-language_cwltool | train | py |
071e656d2815ac8bac7cf8d9e02e21c69a3d1492 | diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java
index <HASH>..<HASH> 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangPort.java
@@ -38,6 +38,7 @@ public class OtpErlangPort extends OtpErlangObject {
*
* @deprecated use OtpLocalNode:createPort() instead
*/
+ @SuppressWarnings("unused")
private OtpErlangPort(final OtpSelf self) {
final OtpErlangPort p = self.createPort(); | mark deprecated unused private constructor | erlang_otp | train | java |
e55411517879765bd2b4dc1c650e4dbb23f28efb | diff --git a/cmd/influxd/run/command.go b/cmd/influxd/run/command.go
index <HASH>..<HASH> 100644
--- a/cmd/influxd/run/command.go
+++ b/cmd/influxd/run/command.go
@@ -68,7 +68,6 @@ func (cmd *Command) Run(args ...string) error {
// Set parallelism.
runtime.GOMAXPROCS(runtime.NumCPU())
- fmt.Fprintf(cmd.Stderr, "GOMAXPROCS set to %d\n", runtime.GOMAXPROCS(0))
// Parse config
config, err := cmd.ParseConfig(options.ConfigPath)
@@ -98,6 +97,10 @@ func (cmd *Command) Run(args ...string) error {
}
cmd.Server = s
+ // Mark start-up in log.
+ log.Printf("InfluxDB starting, version %s, commit %s", cmd.Version, cmd.Commit)
+ log.Println("GOMAXPROCS set to", runtime.GOMAXPROCS(0))
+
// Begin monitoring the server's error channel.
go cmd.monitorServerErrors() | Log GOMAXPROCS, version, and commit on start | influxdata_influxdb | train | go |
8d06285e860bcd89cbc2e1f9d56acf6f4cfa6517 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -108,8 +108,9 @@ describe('pg-bricks', function () {
})
it('should work with accessors', function () {
- pg.select('title').from('item').col().then(function (col) {
- assert.deepEqual(col, ['apple', 'orange']);
+ return pg.select('title,price').from('item').where({title: 'apple'}).row()
+ .then(function (row) {
+ assert.deepEqual(row, {title: 'apple', price: 10});
})
})
}) | Test .row() and fix promise/accessor test | Suor_pg-bricks | train | js |
bea23ddfa395d92b14e2fc794063a5868f19a44d | diff --git a/includes/os/class.Linux.inc.php b/includes/os/class.Linux.inc.php
index <HASH>..<HASH> 100644
--- a/includes/os/class.Linux.inc.php
+++ b/includes/os/class.Linux.inc.php
@@ -149,6 +149,10 @@ class Linux extends OS
$result .= ' [docker]';
}
}
+ if (CommonFunctions::rfts('/proc/version', $strBuf2, 0, 4096, false)
+ && preg_match('/^Linux version [\d\.]+-Microsoft/', $strBuf2)) {
+ $result .= ' [lxss]';
+ }
$this->sys->setKernel($result);
}
}
@@ -1223,11 +1227,6 @@ class Linux extends OS
set_error_handler('errorHandlerPsi');
}
}
- if (preg_match('/^Ubuntu/', $this->sys->getDistribution())
- && CommonFunctions::rfts('/proc/version', $strBuf2, 0, 4096, false)
- && preg_match('/^Linux version [\d\.]+-Microsoft/', $strBuf2)) {
- $this->sys->setDistribution($this->sys->getDistribution().' [Microsoft]' );
- }
}
/** | [Microsoft] to [lxss] | phpsysinfo_phpsysinfo | train | php |
ac18e3060f7a07f1c4b84c8e617cafc380a144a6 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,3 +1,4 @@
+export { observe, unobserve } from '@nx-js/observer-util'
export view from './view'
export store from './store'
export { batch } from './scheduler' | re-export observe and unobserve | solkimicreb_react-easy-state | train | js |
219072f166312a3c8304f109ec3e97908e1102af | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -12,7 +12,7 @@ var compile = function(watch, done) {
var options = {
watch: watch,
output: {
- filename: 'smooth_scrollbar.js'
+ filename: 'angular-smooth-scrollbar.js'
},
module: {
preLoaders: [{
@@ -64,7 +64,7 @@ gulp.task('scripts:build', function() {
});
gulp.task('scripts:release', ['scripts:build'], function() {
- return gulp.src('src/index.js')
+ return gulp.src('index.js')
.pipe(compile(false))
.pipe(uglify())
.pipe(gulp.dest('dist/')); | chore(gulp): update workflow | idiotWu_angular-smooth-scrollbar | train | js |
59d2db4fb09bc3196b76661598f99db0424f64f3 | diff --git a/objectstore/deltablock.go b/objectstore/deltablock.go
index <HASH>..<HASH> 100644
--- a/objectstore/deltablock.go
+++ b/objectstore/deltablock.go
@@ -3,7 +3,6 @@ package objectstore
import (
"fmt"
"github.com/Sirupsen/logrus"
- "github.com/rancher/convoy/convoydriver"
"github.com/rancher/convoy/metadata"
"github.com/rancher/convoy/util"
"io"
@@ -34,10 +33,9 @@ const (
BLOCK_SEPARATE_LAYER2 = 4
)
-func CreateDeltaBlockBackup(volume *Volume, snapshot *Snapshot, destURL string, sDriver convoydriver.ConvoyDriver) (string, error) {
- deltaOps, ok := sDriver.(DeltaBlockBackupOperations)
- if !ok {
- return "", fmt.Errorf("Driver %s doesn't implemented DeltaBlockBackupOperations interface", sDriver.Name())
+func CreateDeltaBlockBackup(volume *Volume, snapshot *Snapshot, destURL string, deltaOps DeltaBlockBackupOperations) (string, error) {
+ if deltaOps == nil {
+ return "", fmt.Errorf("Missing DeltaBlockBackupOperations")
}
bsDriver, err := GetObjectStoreDriver(destURL) | objectstore: Remove reference to convoydriver | rancher_convoy | train | go |
fbef221e27fc1b7abfda5f20f47e66c6a88567e7 | diff --git a/opal/core/string.rb b/opal/core/string.rb
index <HASH>..<HASH> 100644
--- a/opal/core/string.rb
+++ b/opal/core/string.rb
@@ -166,8 +166,10 @@ class String
}
end
- def chars
- each_char.to_a
+ def chars(&block)
+ return each_char.to_a unless block
+
+ each_char(&block)
end
def chomp(separator = $/) | Compliancy fixes for String#chars | opal_opal | train | rb |
f4005175d8d1ceb8967bbe031a1940ff1330d27a | diff --git a/chainntnfs/interface.go b/chainntnfs/interface.go
index <HASH>..<HASH> 100644
--- a/chainntnfs/interface.go
+++ b/chainntnfs/interface.go
@@ -4,6 +4,7 @@ import (
"fmt"
"sync"
+ "github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)
@@ -253,3 +254,17 @@ func SupportedNotifiers() []string {
return supportedNotifiers
}
+
+// ChainConn enables notifiers to pass in their chain backend to interface
+// functions that require it.
+type ChainConn interface {
+ // GetBlockHeader returns the block header for a hash.
+ GetBlockHeader(blockHash *chainhash.Hash) (*wire.BlockHeader, error)
+
+ // GetBlockHeaderVerbose returns the verbose block header for a hash.
+ GetBlockHeaderVerbose(blockHash *chainhash.Hash) (
+ *btcjson.GetBlockHeaderVerboseResult, error)
+
+ // GetBlockHash returns the hash from a block height.
+ GetBlockHash(blockHeight int64) (*chainhash.Hash, error)
+} | chainntnfs/interface: add ChainConn interface
This allows notifiers to pass their chain backend into interface functions to retrieve information from the chain. | lightningnetwork_lnd | train | go |
b3a28bc797f8f6b991badedaef482fcdf3bcc789 | diff --git a/commands/reddit.py b/commands/reddit.py
index <HASH>..<HASH> 100755
--- a/commands/reddit.py
+++ b/commands/reddit.py
@@ -18,7 +18,7 @@ from requests import get
from helpers.command import Command
from helpers.urlutils import get_title, get_short
from helpers.misc import check_exists
-
+import time
@Command(['reddit', 'srepetsk', 'zan'], ['name'])
def cmd(send, msg, args):
@@ -33,5 +33,6 @@ def cmd(send, msg, args):
send("Non-existant subreddit.")
return
subreddit = '/r/%s' % msg if msg else ''
- url = get('http://reddit.com%s/random' % subreddit, headers={'User-Agent': 'CslBot/1.0'}).url
+ urlstr = 'http://reddit.com%s/random?%s' % (subreddit, time.time())
+ url = get(urlstr, headers={'User-Agent': 'CslBot/1.0'}).url
send('** %s - %s' % (get_title(url), get_short(url))) | don't cache reddit random queries | tjcsl_cslbot | train | py |
86c71b38ec9dae47c70508d17ff94effd632b652 | diff --git a/src/Models/CatalogMember.js b/src/Models/CatalogMember.js
index <HASH>..<HASH> 100644
--- a/src/Models/CatalogMember.js
+++ b/src/Models/CatalogMember.js
@@ -40,6 +40,15 @@ var CatalogMember = function(application) {
this.description = '';
/**
+ * An array of section titles and contents for display in the layer info panel.
+ * In future this may replace 'description' above. Content will be rendered using sanitizeHtml.
+ * This property is observable.
+ * @type {{name:string, content:string}}
+ * @default []
+ */
+ this.info = [];
+
+ /**
* Gets or sets a value indicating whether this member was supplied by the user rather than loaded from one of the
* {@link Application#initSources}. User-supplied members must be serialized completely when, for example,
* serializing enabled members for sharing. This property is observable. | Initialise and document new info field in CatalogMember | TerriaJS_terriajs | train | js |
9b9f2e6deaf758cd8e4c59f09c29c65b4b2d2f71 | diff --git a/lib/rpush/daemon/dispatcher/apns_tcp.rb b/lib/rpush/daemon/dispatcher/apns_tcp.rb
index <HASH>..<HASH> 100644
--- a/lib/rpush/daemon/dispatcher/apns_tcp.rb
+++ b/lib/rpush/daemon/dispatcher/apns_tcp.rb
@@ -35,6 +35,12 @@ module Rpush
end
def cleanup
+ if Rpush.config.push
+ # In push mode only a single batch is sent, followed my immediate shutdown.
+ # Allow the error receiver time to handle any errors.
+ sleep 1
+ end
+
@stop_error_receiver = true
super
@error_receiver_thread.join if @error_receiver_thread | Allow APNs time to handle errors in push mode. | rpush_rpush | train | rb |
61f5cc181dfa661591cd8bc0a764a0d04949dced | diff --git a/tools/lxdclient/client_network.go b/tools/lxdclient/client_network.go
index <HASH>..<HASH> 100644
--- a/tools/lxdclient/client_network.go
+++ b/tools/lxdclient/client_network.go
@@ -55,7 +55,7 @@ func checkBridgeConfig(client rawNetworkClient, bridge string) error {
return err
}
- if n.Config["ipv6.address"] != "none" {
+ if n.Managed && n.Config["ipv6.address"] != "none" {
return errors.Errorf(`juju doesn't support ipv6. Please disable LXD's IPV6:
$ lxc network set %s ipv6.address none | Ask to disable ipv6 on lxd network when lxd manages it. | juju_juju | train | go |
54eddbdb6c21ee676ba8282070e678ce7361e677 | diff --git a/agrona/src/test/java/org/agrona/collections/IntHashSetTest.java b/agrona/src/test/java/org/agrona/collections/IntHashSetTest.java
index <HASH>..<HASH> 100644
--- a/agrona/src/test/java/org/agrona/collections/IntHashSetTest.java
+++ b/agrona/src/test/java/org/agrona/collections/IntHashSetTest.java
@@ -763,6 +763,25 @@ public class IntHashSetTest
}
@Test
+ public void consecutiveValuesShouldBeCorrectlyStored() throws Exception
+ {
+ for (int i = 0; i < 10_000; i++)
+ {
+ testSet.add(i);
+ }
+
+ assertThat(testSet, hasSize(10_000));
+
+ int distinctElements = 0;
+ for (final int ignore : testSet)
+ {
+ distinctElements++;
+ }
+
+ assertThat(distinctElements, is(10_000));
+ }
+
+ @Test
public void hashCodeAccountsForMissingValue()
{
addTwoElements(testSet); | [Java] Add test for counting distinct elements. | real-logic_agrona | train | java |
f28056332aa0f57ff08d983ee87ef3b7da15c404 | diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js
index <HASH>..<HASH> 100644
--- a/packages/eslint-config/index.js
+++ b/packages/eslint-config/index.js
@@ -20,7 +20,7 @@ module.exports = {
'.js',
'.json',
'.marko',
- '.vue',
+ // '.vue', // TODO: Remove if unnecessary; should work via webpack's resolver anyway
]},
},
'html/html-extensions': ['.html', '.marko'], // not .vue; it has its own parser | Comment out vue in node resolver for eslint | WeAreGenki_ui | train | js |
d50b419e5a4c4a3fdf6348b997c3c501f3c353dc | diff --git a/server/pages/index.js b/server/pages/index.js
index <HASH>..<HASH> 100644
--- a/server/pages/index.js
+++ b/server/pages/index.js
@@ -759,6 +759,7 @@ module.exports = function() {
authorized: true,
supportUser: req.query.support_user,
supportToken: req.query._support_token,
+ supportPath: req.query.support_path,
} )
);
} ); | Support User: make path work in environments other than development (#<I>) | Automattic_wp-calypso | train | js |
863ebd255ba8947bcf3b015685c615546567200d | diff --git a/lib/html/pipeline/sanitization_filter.rb b/lib/html/pipeline/sanitization_filter.rb
index <HASH>..<HASH> 100644
--- a/lib/html/pipeline/sanitization_filter.rb
+++ b/lib/html/pipeline/sanitization_filter.rb
@@ -57,7 +57,7 @@ module HTML
'border', 'cellpadding', 'cellspacing', 'char',
'charoff', 'charset', 'checked', 'cite',
'clear', 'cols', 'colspan', 'color',
- 'compact', 'coords', 'datetime', 'dir',
+ 'compact', 'coords', 'datetime', 'details', 'dir',
'disabled', 'enctype', 'for', 'frame',
'headers', 'height', 'hreflang',
'hspace', 'ismap', 'label', 'lang', | adding "details" to tag whitelist | jch_html-pipeline | train | rb |
4ffc90193d2935b15579e1c1d1f2dfd4eca2afb8 | diff --git a/lago/virt.py b/lago/virt.py
index <HASH>..<HASH> 100644
--- a/lago/virt.py
+++ b/lago/virt.py
@@ -296,11 +296,11 @@ class VirtEnv(object):
Args:
domanins(list of str): list of the domains to get the snapshots
- for, all will be returned if none or empty list passed
+ for, all will be returned if none or empty list passed
Returns:
dict of str -> list(str): with the domain names and the list of
- snapshots for each
+ snapshots for each
"""
snapshots = {}
for vm_name, vm in self.get_vms().items(): | Fixed a couple of doc warnings | lago-project_lago | train | py |
aab96e33f117dfd35a84fb4a3748966dd2b53096 | diff --git a/minio/thread_pool.py b/minio/thread_pool.py
index <HASH>..<HASH> 100644
--- a/minio/thread_pool.py
+++ b/minio/thread_pool.py
@@ -67,7 +67,7 @@ class ThreadPool:
def __init__(self, num_threads):
self.results_queue = queue()
self.exceptions_queue = queue()
- self.tasks_queue = queue()
+ self.tasks_queue = queue(num_threads)
self.num_threads = num_threads
def add_task(self, func, *args, **kargs): | put_object: Limit tasks queue size to avoid reading the whole data (#<I>)
put_object() prepares parts much more faster than uploading them,
the thing which leads to load all the data, such as a local file, in
the memory, which by itself can lead to a OOM.
This PR will allow only `num_threads` parallel task preparation of
parts data before multipart uploading them. | minio_minio-py | train | py |
a09f20ab4522e1498b109c9263d27fa65cd6d3b5 | diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py
index <HASH>..<HASH> 100644
--- a/salt/modules/cmdmod.py
+++ b/salt/modules/cmdmod.py
@@ -475,7 +475,7 @@ def _run(cmd,
else:
raise CommandExecutionError(
'Environment could not be retrieved for User \'{0}\':'
- ' missing a marker, got err={1!r} out={2!r}'.format(
+ ' missing a marker, got err={1} out={2}'.format(
runas,
repr(env_encoded_err),
repr(env_encoded_org) | fix repr for the linter | saltstack_salt | train | py |
c3b89eeedd951feb0a49edd15e0e5ed10670590a | diff --git a/tests/Symfony/Tests/Component/Form/DateTimeFieldTest.php b/tests/Symfony/Tests/Component/Form/DateTimeFieldTest.php
index <HASH>..<HASH> 100644
--- a/tests/Symfony/Tests/Component/Form/DateTimeFieldTest.php
+++ b/tests/Symfony/Tests/Component/Form/DateTimeFieldTest.php
@@ -169,6 +169,7 @@ class DateTimeFieldTest extends DateTimeTestCase
'with_seconds' => true,
));
+ $field->setLocale('de_AT');
$field->setData(new \DateTime('2010-06-02 03:04:05 UTC'));
$html = <<<EOF | [Form] fixed failing unit test due | symfony_symfony | train | php |
64d48b3f0cdd8f318d7bc1adc5223d285dbae8e3 | diff --git a/libusb1.py b/libusb1.py
index <HASH>..<HASH> 100644
--- a/libusb1.py
+++ b/libusb1.py
@@ -654,11 +654,11 @@ def libusb_fill_control_transfer(transfer_p, dev_handle, buffer, callback,
transfer.endpoint = 0
transfer.type = LIBUSB_TRANSFER_TYPE_CONTROL
transfer.timeout = timeout
+ transfer.buffer = cast(buffer, c_void_p)
if buffer is not None:
setup = cast(buffer, libusb_control_setup_p).contents
transfer.length = LIBUSB_CONTROL_SETUP_SIZE + \
libusb_le16_to_cpu(setup.wLength)
- transfer.buffer = cast(buffer, c_void_p)
transfer.user_data = user_data
transfer.callback = callback | Always set buffer in libusb_fill_control_transfer. | vpelletier_python-libusb1 | train | py |
8103a5b70b807afb95f25af95ce3f8f6f7cdc994 | diff --git a/evm/chains/chain.py b/evm/chains/chain.py
index <HASH>..<HASH> 100644
--- a/evm/chains/chain.py
+++ b/evm/chains/chain.py
@@ -76,11 +76,12 @@ class Chain(Configurable):
self.gas_estimator = get_gas_estimator()
@classmethod
- def configure(cls, name, vm_configuration, **overrides):
+ def configure(cls, name=None, vm_configuration=None, **overrides):
if 'vms_by_range' in overrides:
raise ValueError("Cannot override vms_by_range")
- overrides['vms_by_range'] = generate_vms_by_range(vm_configuration)
+ if vm_configuration is not None:
+ overrides['vms_by_range'] = generate_vms_by_range(vm_configuration)
return super().configure(name, **overrides)
# | Make vm_configuration optional to allow multi-step configuration (#<I>) | ethereum_py-evm | train | py |
cbc86e47e5084c39aac48cafa7187d58369a3832 | diff --git a/src/convnet_export.js b/src/convnet_export.js
index <HASH>..<HASH> 100644
--- a/src/convnet_export.js
+++ b/src/convnet_export.js
@@ -1,7 +1,7 @@
(function(lib) {
"use strict";
if (typeof module === "undefined" || typeof module.exports === "undefined") {
- window.jsfeat = lib; // in ordinary browser attach library to window
+ window.convnetjs = lib; // in ordinary browser attach library to window
} else {
module.exports = lib; // in nodejs
} | removing jsfeat legacy on export | karpathy_convnetjs | train | js |
ed533b4c6f2cd365484a3d57ac2bbba71c8e55a4 | diff --git a/kubernetes_asyncio/config/kube_config_test.py b/kubernetes_asyncio/config/kube_config_test.py
index <HASH>..<HASH> 100644
--- a/kubernetes_asyncio/config/kube_config_test.py
+++ b/kubernetes_asyncio/config/kube_config_test.py
@@ -526,9 +526,10 @@ class TestKubeConfigLoader(BaseTestCase):
def test_load_gcp_token_with_refresh(self):
- def cred(): return None
- cred.token = TEST_ANOTHER_DATA_BASE64
- cred.expiry = datetime.datetime.now()
+ cred = SimpleNamespace(
+ token=TEST_ANOTHER_DATA_BASE64,
+ expiry=datetime.datetime.now(),
+ )
loader = KubeConfigLoader(
config_dict=self.TEST_KUBE_CONFIG, | Replaced namespace hack with clean solution. | tomplus_kubernetes_asyncio | train | py |
d9abade37fdda933265b540d039c05fa2fabbe49 | diff --git a/lib/filemaker/model/pagination.rb b/lib/filemaker/model/pagination.rb
index <HASH>..<HASH> 100644
--- a/lib/filemaker/model/pagination.rb
+++ b/lib/filemaker/model/pagination.rb
@@ -5,7 +5,7 @@ module Filemaker
def page(value)
value = 1 if value.nil?
chains << :page
- @_page = value.to_i
+ @_page = positive_page(value.to_i)
update_skip
end
@@ -37,6 +37,11 @@ module Filemaker
skip(skip) unless skip.zero?
self
end
+
+ def positive_page(page)
+ return 1 if page.nil? || !page.is_a?(Integer)
+ page.positive? ? page : 1
+ end
end
end
end | Page number should be positive and non-zero | mech_filemaker-ruby | train | rb |
02a54456985135eabe0cb5924cb63fbed9e9c0c4 | diff --git a/programs/thumbnails.py b/programs/thumbnails.py
index <HASH>..<HASH> 100755
--- a/programs/thumbnails.py
+++ b/programs/thumbnails.py
@@ -11,8 +11,8 @@ from pmagpy import pmag
def error_log(msg):
with open('thumbnail_errors.txt', 'a') as log:
- log.write(msg + '\t' + str(datetime.datetime.now()) + '\t')
- sys.stderr.write(msg)
+ log.write(msg + '\t' + str(datetime.datetime.now()) + '\n')
+ sys.stderr.write(msg + '\n')
def make_thumbnails(directory=".", fmt="png"):
# get all the jpg files from the current folder
@@ -75,9 +75,9 @@ def make_thumbnails(directory=".", fmt="png"):
right = width * .84
bottom = height * .81
else:
- error_log("Could not create a thumbnail for {}".format(infile))
+ error_log("Could not crop {}".format(infile))
+ im.save(infile[:-4] + ".thumb.{}".format(fmt), fmt, dpi=(300, 300))
continue
-
cropped = im.crop((left, top, right, bottom))
#cropped_example.show()
cropped.thumbnail((300, 300), Image.ANTIALIAS) | make un-cropped thumbnails for unrecognized plot types, #<I> | PmagPy_PmagPy | train | py |
d218cb6a549778e14f0333cbee278d6cb69f49fc | diff --git a/thinc/tests/backends/test_ops.py b/thinc/tests/backends/test_ops.py
index <HASH>..<HASH> 100644
--- a/thinc/tests/backends/test_ops.py
+++ b/thinc/tests/backends/test_ops.py
@@ -628,8 +628,8 @@ def test_softmax_temperature(ops, temperature):
Yt, dXt = torch_softmax_with_temperature(X, dY, temperature)
- assert_allclose(Y, Yt, atol=1e-6)
- assert_allclose(dX, dXt, atol=1e-6)
+ ops.xp.testing.assert_allclose(Y, Yt, atol=1e-6)
+ ops.xp.testing.assert_allclose(dX, dXt, atol=1e-6)
@pytest.mark.parametrize("cpu_ops", [*CPU_OPS, BLIS_OPS]) | test_softmax_temperature: use assert_allclose from ops
This avoids that the test fails with CupyOps. | explosion_thinc | train | py |
2abe1704e69886711b4b3b8bafe946822a57f7cc | diff --git a/js/load-image-scale.js b/js/load-image-scale.js
index <HASH>..<HASH> 100644
--- a/js/load-image-scale.js
+++ b/js/load-image-scale.js
@@ -40,7 +40,7 @@
// Transform image coordinates, allows to override e.g.
// the canvas orientation based on the orientation option,
- // gets canvas, options passed as arguments:
+ // gets canvas, options and data passed as arguments:
loadImage.transformCoordinates = function () {}
// Returns transformed options, allows to override e.g.
@@ -121,6 +121,8 @@
loadImage.scale = function (img, options, data) {
// eslint-disable-next-line no-param-reassign
options = options || {}
+ // eslint-disable-next-line no-param-reassign
+ data = data || {}
var canvas = document.createElement('canvas')
var useCanvas =
img.getContext ||
@@ -168,7 +170,7 @@
}
if (useCanvas) {
// eslint-disable-next-line no-param-reassign
- options = loadImage.getTransformedOptions(img, options, data || {})
+ options = loadImage.getTransformedOptions(img, options, data)
sourceX = options.left || 0
sourceY = options.top || 0
if (options.sourceWidth) {
@@ -285,7 +287,7 @@
}
canvas.width = destWidth
canvas.height = destHeight
- loadImage.transformCoordinates(canvas, options)
+ loadImage.transformCoordinates(canvas, options, data)
return loadImage.renderImageToCanvas(
canvas,
img, | Pass data object to transformCoordinates function. | blueimp_JavaScript-Load-Image | train | js |
7a4700f0d21d44b869719d1f00498a4a9592c41c | diff --git a/azurerm/internal/provider/provider.go b/azurerm/internal/provider/provider.go
index <HASH>..<HASH> 100644
--- a/azurerm/internal/provider/provider.go
+++ b/azurerm/internal/provider/provider.go
@@ -253,6 +253,9 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc {
// replaces the context between tests
p.MetaReset = func() error {
+ // hack to allow the test suite to run without defining `features{}` everywhere
+ client.Features = expandFeatures([]interface{}{})
+
client.StopContext = p.StopContext()
return nil
} | provider: hooking into the test refresh to set default features | terraform-providers_terraform-provider-azurerm | train | go |
047f447112c3d71cbe119c21c7d897bb2aed69d6 | diff --git a/src/Client/Utils/A.php b/src/Client/Utils/A.php
index <HASH>..<HASH> 100644
--- a/src/Client/Utils/A.php
+++ b/src/Client/Utils/A.php
@@ -50,4 +50,20 @@ class A
{
return RequestBuilder::create('fetch');
}
-}
+
+ /**
+ * @return \Mcustiel\Phiremock\Client\Utils\RequestBuilder
+ */
+ public static function deleteRequest()
+ {
+ return RequestBuilder::create('delete');
+ }
+
+ /**
+ * @return \Mcustiel\Phiremock\Client\Utils\RequestBuilder
+ */
+ public static function patchRequest()
+ {
+ return RequestBuilder::create('patch');
+ }
+}
\ No newline at end of file | Added delete & patch request. | mcustiel_phiremock | train | php |
5fed9bd2c3a08908069947fe6c4abdca5acbb60f | diff --git a/pyxel/app.py b/pyxel/app.py
index <HASH>..<HASH> 100644
--- a/pyxel/app.py
+++ b/pyxel/app.py
@@ -1,6 +1,5 @@
import datetime
import gzip
-import inspect
import math
import os
import pickle
@@ -160,6 +159,7 @@ class App:
module.btnp = self.btnp
module.btnr = self.btnr
module.run = self.run
+ module.run_with_profiler = self.run_with_profiler
module.quit = self.quit
module.save = self.save
module.load = self.load
@@ -223,6 +223,28 @@ class App:
else:
main_loop()
+ def run_with_profiler(self, update, draw):
+ import cProfile
+ import pstats
+
+ profile = cProfile.Profile()
+ profile.enable()
+ profile.runcall(self.run, update, draw)
+ profile.disable()
+
+ stats = pstats.Stats(profile).strip_dirs().sort_stats("tottime")
+ frame_count = self._module.frame_count
+
+ for key in stats.stats:
+ cc, nc, tt, ct, callers = stats.stats[key]
+ cc = round(cc / frame_count, 3)
+ nc = round(nc / frame_count, 3)
+ tt *= 1000 / frame_count
+ ct *= 1000 / frame_count
+ stats.stats[key] = (cc, nc, tt, ct, callers)
+
+ stats.print_stats(30)
+
def quit(self):
glfw.set_window_should_close(self._window, True) | Added the run_with_profiler command | kitao_pyxel | train | py |
a1ad82929192d51b803664dfa1a74466d2ba50b9 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -24,9 +24,7 @@ module.exports = function gruntConf(grunt) {
encoding: 'ascii'
},
files: {
- tmp: [
- 'test/fixtures/default.txt'
- ]
+ tmp: ['test/fixtures/default.txt']
}
},
noChangeNoTrim: {
@@ -39,23 +37,17 @@ module.exports = function gruntConf(grunt) {
},
otherLineEndsOldMac: {
files: {
- tmp: [
- 'test/fixtures/other-line-ends-old-mac.txt'
- ]
+ tmp: ['test/fixtures/other-line-ends-old-mac.txt']
}
},
otherLineEndsUnix: {
files: {
- tmp: [
- 'test/fixtures/other-line-ends-unix.txt'
- ]
+ tmp: ['test/fixtures/other-line-ends-unix.txt']
}
},
otherLineEndsWindows: {
files: {
- tmp: [
- 'test/fixtures/other-line-ends-windows.txt'
- ]
+ tmp: ['test/fixtures/other-line-ends-windows.txt']
}
}
/* | Fix a bit of linting | paazmaya_grunt-trimtrailingspaces | train | js |
dec736c156195a7bf49f0de1d3010ae38707e511 | diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/utils/__init__.py
+++ b/salt/utils/__init__.py
@@ -387,7 +387,7 @@ def required_modules_error(name, docstring):
return msg.format(filename, ', '.join(modules))
-def prep_jid(cachedir, sum_type, user='root'):
+def prep_jid(cachedir, sum_type, user='root', nocache=False):
'''
Return a job id and prepare the job id directory
'''
@@ -398,8 +398,10 @@ def prep_jid(cachedir, sum_type, user='root'):
os.makedirs(jid_dir_)
with fopen(os.path.join(jid_dir_, 'jid'), 'w+') as fn_:
fn_.write(jid)
+ with fopen(os.path.join(jid_dir_, 'nocache'), 'w+') as fn_:
+ fn_.write('')
else:
- return prep_jid(cachedir, sum_type)
+ return prep_jid(cachedir, sum_type, user=user, nocache=nocache)
return jid | Add the creation of the nocache file to the jid_dir | saltstack_salt | train | py |
609a986ebbe882adf9f99acd78a272f5d5fe64a8 | diff --git a/src/wizard.js b/src/wizard.js
index <HASH>..<HASH> 100644
--- a/src/wizard.js
+++ b/src/wizard.js
@@ -138,8 +138,9 @@ angular.module('mgo-angular-wizard').directive('wizard', function() {
defer.resolve(response);
});
return defer.promise;
+ } else {
+ return canEnter === true;
}
- return step.canenter($scope.context) === true;
}
function canExitStep(step, stepTo) { | fixed error causing canenter function to call twice | angular-wizard_angular-wizard | train | js |
8381c4c10c01101ba0fa94ddd98971e2245839ff | diff --git a/lib/Thelia/Model/Tools/PositionManagementTrait.php b/lib/Thelia/Model/Tools/PositionManagementTrait.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Model/Tools/PositionManagementTrait.php
+++ b/lib/Thelia/Model/Tools/PositionManagementTrait.php
@@ -201,8 +201,17 @@ trait PositionManagementTrait {
protected function reorderBeforeDelete()
{
- $this->createQuery()
- ->filterByParent($this->getParent())
- ->update(array('Position' => '(position-1)'));
+ // Find DATABASE_NAME constant
+ $mapClassName = self::TABLE_MAP;
+
+ $sql = sprintf("UPDATE `%s` SET position=(position-1) WHERE parent=:parent AND position>:position", $mapClassName::TABLE_NAME);
+
+ $con = Propel::getConnection($mapClassName::DATABASE_NAME);
+ $statement = $con->prepare($sql);
+
+ $statement->execute(array(
+ ':parent' => $this->getParent(),
+ ':position' => $this->getPosition()
+ ));
}
}
\ No newline at end of file | fix reorder position on folder and category removal | thelia_core | train | php |
57e3819efd4170248797a6e7f3543e10aaac45e4 | diff --git a/salt/modules/virt.py b/salt/modules/virt.py
index <HASH>..<HASH> 100644
--- a/salt/modules/virt.py
+++ b/salt/modules/virt.py
@@ -1878,7 +1878,7 @@ def delete_snapshots(name, *names, **kwargs):
def revert_snapshot(name, snapshot=None, cleanup=False):
'''
- Revert snapshot to the previous (if available) or to the specific.
+ Revert snapshot to the previous from current (if available) or to the specific.
Options: | Fix docstring for snapshot reversion | saltstack_salt | train | py |
887e266761dcd9c64f1ba9c4dce4d4c1c8efec2c | diff --git a/src/main/java/com/meltmedia/jgroups/aws/AWS_PING.java b/src/main/java/com/meltmedia/jgroups/aws/AWS_PING.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/meltmedia/jgroups/aws/AWS_PING.java
+++ b/src/main/java/com/meltmedia/jgroups/aws/AWS_PING.java
@@ -84,8 +84,8 @@ public class AWS_PING
HttpClient client = null;
try {
client = new DefaultHttpClient();
- instanceId = getUrl(client, INSTANCE_METADATA_BASE_URI);
- localAddress = getUrl(client, INSTANCE_METADATA_BASE_URI);
+ instanceId = getUrl(client, GET_INSTANCE_ID);
+ localAddress = getUrl(client, GET_LOCAL_ADDR);
}
finally {
HttpClientUtils.closeQuietly(client); | Corrected URLs for instance id and private address lookup. | meltmedia_jgroups-aws | train | java |
781cb85c49e773251a14a1a3cc34a6ba6767d328 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -25,4 +25,6 @@ exports.Class = require('./class')
exports.Class.Options = require('./class/options')
exports.http = require('./http')
exports.constants = require('./constants')
+exports.fields = require('./fields' )
exports.urljoin = require('urljoin')
+ | include fields onto top level exports. | node-tastypie_tastypie | train | js |
315ba035bf50abe1106a36968ed0e20b29ced807 | diff --git a/test/spec.js b/test/spec.js
index <HASH>..<HASH> 100644
--- a/test/spec.js
+++ b/test/spec.js
@@ -5,9 +5,13 @@ const glob = require("glob");
const WebAssembly = require("../lib");
+const TEST_WHITELIST = ["spec/test/core/exports.wast"];
+
describe("spec", () => {
describe("watf", () => {
- const testSuites = glob.sync("spec/test/core/**/*.wast");
+ const testSuites = glob
+ .sync("spec/test/core/**/*.wast")
+ .filter(suite => TEST_WHITELIST.indexOf(suite) !== -1);
testSuites.forEach(suite => {
describe(suite, () => { | feat: add whitelist in spec tests | xtuc_webassemblyjs | train | js |
0764a69c97f6d891beacfc31be8bd7fe9bd9173d | diff --git a/test/mailer_test.rb b/test/mailer_test.rb
index <HASH>..<HASH> 100644
--- a/test/mailer_test.rb
+++ b/test/mailer_test.rb
@@ -17,6 +17,13 @@ class UserMailer < ActionMailer::Base
mail to: "test@example.org", subject: "Hello", body: "World"
end
+ def welcome4
+ track click: false
+ mail to: "test@example.org", subject: "Hello" do |format|
+ format.html { render text: '<a href="http://example.org">Hi<a>' }
+ end
+ end
+
private
def prevent_delivery_to_guests
@@ -45,6 +52,14 @@ class MailerTest < Minitest::Test
assert_equal 0, Ahoy::Message.count
end
+ def test_utm_params
+ message = UserMailer.welcome4
+ body = message.body.to_s
+ assert_match "utm_campaign=welcome4", body
+ assert_match "utm_medium=email", body
+ assert_match "utm_source=user_mailer", body
+ end
+
def assert_message(method)
message = UserMailer.send(method)
message.respond_to?(:deliver_now) ? message.deliver_now : message.deliver | Added utm_params test | ankane_ahoy_email | train | rb |
adcb3efedc8aa20bd114cbb1f7c7b9efeddd45c2 | diff --git a/spice_api/spice.py b/spice_api/spice.py
index <HASH>..<HASH> 100644
--- a/spice_api/spice.py
+++ b/spice_api/spice.py
@@ -42,7 +42,9 @@ The spice API exposes several functions for access to MAL:
5) delete() - Delete an anime/manga from a list.
6) get_list() - Gets a user's Anime/MangaList.
7) get_blank() - Returns a blank Anime or MangaData object.
-8) get_user_id() - Returns the authenticated user's id.
+8) get_status() - Returns the status token for the given status string.
+9) get_status_num() - Returns the status number for the given token or string.
+10) get_medium() - Returns the medium token for the given string.
The MediumList object returned by get_list() also exposes some useful functionality:
1) avg_score() - Returns the user's average score across anime/manga watched. | Update docs in spice.py | Utagai_spice | train | py |
55c9a61a759e871023cd40cae30753a411b05220 | diff --git a/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java b/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java
index <HASH>..<HASH> 100644
--- a/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java
+++ b/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java
@@ -1077,14 +1077,10 @@ public final class InodeTree implements JournalCheckpointStreamable {
private static final class TraversalResult {
private final boolean mFound;
- /**
- * The list of non-persisted inodes encountered during the traversal.
- */
+ /** The list of non-persisted inodes encountered during the traversal. */
private final List<Inode<?>> mNonPersisted;
- /**
- * The list of all inodes encountered during the traversal.
- */
+ /** The list of all inodes encountered during the traversal. */
private final List<Inode<?>> mInodes;
/** The {@link InodeLockList} managing the locks for the inodes. */ | Fix style for javadoc member variables | Alluxio_alluxio | train | java |
e4db6ae2f5a2792955bf5a3b0d75bee651da136b | diff --git a/src/services/MixService.php b/src/services/MixService.php
index <HASH>..<HASH> 100644
--- a/src/services/MixService.php
+++ b/src/services/MixService.php
@@ -86,8 +86,9 @@ class MixService extends Component
Craft::info('Mix: ' . printf($e->getMessage()), __METHOD__);
}
- if ($manifest) {
- $file = $manifest['/' . ltrim($file, '/')];
+ $fileKey = '/' . ltrim($file, '/');
+ if (is_array($manifest) && isset($manifest[$fileKey])) {
+ $file = $manifest[$fileKey];
}
return '/' . implode('/', array_filter([ | Make the manifest file key check more safe | mister-bk_craft-plugin-mix | train | php |
fad93e8aa178e2b4bab9ad7c72fcc0a4ed784cd2 | diff --git a/lib/silo/cli.rb b/lib/silo/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/silo/cli.rb
+++ b/lib/silo/cli.rb
@@ -81,8 +81,8 @@ module Silo
Repository.new path
end
- flag :l
- flag :r
+ flag :l, 'List each object in a separate line'
+ flag :r, 'Reverse list order'
command :list, 'List the contents of a repository', :paths => [ :remainder, :optional ] do
paths = self.paths || [nil]
contents = []
diff --git a/lib/silo/repository.rb b/lib/silo/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/silo/repository.rb
+++ b/lib/silo/repository.rb
@@ -132,7 +132,7 @@ module Silo
def contents(path = nil)
contents = []
- object = find_object path
+ object = find_object(path || '/')
contents << path unless path.nil? || object.nil?
if object.is_a? Grit::Tree
(object.blobs + object.trees).each do |obj| | Fixed repository listing
Also added info to the corresponding CLI flags | koraktor_silo | train | rb,rb |
0e189e669eb9da32293f988eeae8bb94eb8b5c2b | diff --git a/src/main/java/com/plivo/api/models/token/TokenCreator.java b/src/main/java/com/plivo/api/models/token/TokenCreator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/plivo/api/models/token/TokenCreator.java
+++ b/src/main/java/com/plivo/api/models/token/TokenCreator.java
@@ -70,6 +70,7 @@ public class TokenCreator extends VoiceCreator<TokenCreateResponse> {
public TokenCreator per(final JSONObject per) {
JSONObject permission = new JSONObject();
JSONObject voice = new JSONObject();
+ voice.put("incoming_allow", incoming_allow);
voice.put("outgoing_allow", outgoing_allow);
permission.put("voice", voice);
this.per = permission; | Added incoming_allow in tokenCreate | plivo_plivo-java | train | java |
1cd51e25f72e411b93976d6f2dc350312c4d72d9 | diff --git a/lib/transforms/populate.js b/lib/transforms/populate.js
index <HASH>..<HASH> 100644
--- a/lib/transforms/populate.js
+++ b/lib/transforms/populate.js
@@ -60,8 +60,8 @@ exports.populate = function (includeRelationQuery) {
from: asset,
assetConfig: resolvedAssetConfig
});
- relation.from.attachRelation(relation, 'before', originalRelation);
initializeAndAddRelation(relation);
+ relation.from.attachRelation(relation, 'before', originalRelation);
});
asset.detachRelation(originalRelation);
} else { | populate transforms: Initialize the target asset before attaching a "multiplied" relation so that it can be inspected by the source asset's attachRelation method. | assetgraph_assetgraph | train | js |
400061e24aa5720be31180ae954025ea4b489144 | diff --git a/abydos/compression/_arithmetic.py b/abydos/compression/_arithmetic.py
index <HASH>..<HASH> 100644
--- a/abydos/compression/_arithmetic.py
+++ b/abydos/compression/_arithmetic.py
@@ -323,8 +323,7 @@ def ac_encode(text, probs):
"""
coder = Arithmetic()
- if probs is not None:
- coder.set_probs(probs)
+ coder.set_probs(probs)
return coder.encode(text)
@@ -356,8 +355,7 @@ def ac_decode(longval, nbits, probs):
"""
coder = Arithmetic()
- if probs is not None:
- coder.set_probs(probs)
+ coder.set_probs(probs)
return coder.decode(longval, nbits) | removed branch (this wouldn't work if false) | chrislit_abydos | train | py |
42b782ae3ba7293f8032f5e761dd14ebe93634ac | diff --git a/src/FS.js b/src/FS.js
index <HASH>..<HASH> 100644
--- a/src/FS.js
+++ b/src/FS.js
@@ -55,7 +55,7 @@ FS.mkdirs = FS.mkdirp
// ----------------------------
FS.exists = pathname => {
return FS.stat(pathname).then(() => true).catch(err => {
- if(err.code !== 'ENOENT') {
+ if(err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
throw err
} | Updated FS.exists to support ENOTDIR | grindjs_support | train | js |
ac395a60ed2ac643403678991ff4745231ff48c5 | diff --git a/cell.go b/cell.go
index <HASH>..<HASH> 100644
--- a/cell.go
+++ b/cell.go
@@ -94,7 +94,7 @@ func (f *File) SetCellValue(sheet, axis string, value interface{}) error {
case nil:
err = f.SetCellStr(sheet, axis, "")
default:
- err = f.SetCellStr(sheet, axis, fmt.Sprintf("%v", value))
+ err = f.SetCellStr(sheet, axis, fmt.Sprint(value))
}
return err
} | SetCellValue: use fmt.Sprint(v) instead of fmt.Sprintf("%v", v)
Because that does the same thing, but without having to parse a format
string. | 360EntSecGroup-Skylar_excelize | train | go |
671349548defb3da4231802e25b04138edba4d0d | diff --git a/public/javascripts/panel.js b/public/javascripts/panel.js
index <HASH>..<HASH> 100644
--- a/public/javascripts/panel.js
+++ b/public/javascripts/panel.js
@@ -864,6 +864,16 @@ KT.panel.list = (function () {
$.bbq.removeState("search");
$('#search_form').trigger('submit');
}
+ }).live('keypress', function(event){
+ var button = $('#search_button');
+
+ if( event.keyCode === 13 ){
+ event.preventDefault();
+
+ if( button.attr('disabled') !== "disabled" ){
+ $('#search_form').trigger('submit');
+ }
+ }
});
};
return { | <I> - Fixes issue with duplicate search results being returned that stemmed from pressing enter within the search field too many times. | Katello_katello | train | js |
e5515e219a0bd32d9a28c770914dd9769a744417 | diff --git a/chef/lib/chef/resource.rb b/chef/lib/chef/resource.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/resource.rb
+++ b/chef/lib/chef/resource.rb
@@ -162,10 +162,18 @@ class Chef
if args.size > 1
notifies_helper(*args)
else
- resources_array = *args
- resources_array.each do |resource|
- resource.each do |key, value|
- notifies_helper(value[0], key, value[1])
+ # This syntax is so weird. surely people will just give us one hash?
+ notifications = args.flatten
+ notifications.each do |resources_notifications|
+ begin
+ resources_notifications.each do |resource, notification|
+ Chef::Log.error "resource KV: `#{resource.inspect}' => `#{notification.inspect}'"
+ notifies_helper(notification[0], resource, notification[1])
+ end
+ rescue NoMethodError
+ Chef::Log.fatal("encountered NME processing resource #{resources_notifications.inspect}")
+ Chef::Log.fatal("incoming args: #{args.inspect}")
+ raise
end
end
end | [CHEF-<I>] can't use the splat operator like that in <I> | chef_chef | train | rb |
f69fd50e204d46b1464daca0f47397f148952887 | diff --git a/src/RedisQueue.php b/src/RedisQueue.php
index <HASH>..<HASH> 100644
--- a/src/RedisQueue.php
+++ b/src/RedisQueue.php
@@ -95,6 +95,20 @@ class RedisQueue extends BaseQueue
{
$payload = (new JobPayload($this->createPayload($job, $queue, $data)))->prepare($job)->value;
+ if (method_exists($this, 'enqueueUsing')) {
+ return $this->enqueueUsing(
+ $job,
+ $payload,
+ $queue,
+ $delay,
+ function ($payload, $queue, $delay) {
+ return tap(parent::laterRaw($delay, $payload, $queue), function () use ($payload, $queue) {
+ $this->event($this->getQueue($queue), new JobPushed($payload));
+ });
+ }
+ );
+ }
+
return tap(parent::laterRaw($delay, $payload, $queue), function () use ($payload, $queue) {
$this->event($this->getQueue($queue), new JobPushed($payload));
}); | use enqueueUsing when pushing delayed jobs (#<I>) | laravel_horizon | train | php |
c293c0be97e2877d8e20d033f881044856f16f6b | diff --git a/src/picoModal.js b/src/picoModal.js
index <HASH>..<HASH> 100644
--- a/src/picoModal.js
+++ b/src/picoModal.js
@@ -568,13 +568,11 @@
manageFocus(iface, getOption.bind(null, "focus", true));
// If a user presses the 'escape' key, close the modal.
- if ( getOption("escCloses", true) ) {
- escapeKey.watch(function escapeKeyPress () {
- if ( iface.isVisible() ) {
- iface.close();
- }
- });
- }
+ escapeKey.watch(function escapeKeyPress () {
+ if ( getOption("escCloses", true) && iface.isVisible() ) {
+ iface.close();
+ }
+ });
return iface;
}; | Allow escCloses to be changed | Nycto_PicoModal | train | js |
41b600bc1f6a7e197b9b9c909bd9c3a53362e6be | diff --git a/lib/twitter/version.rb b/lib/twitter/version.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter/version.rb
+++ b/lib/twitter/version.rb
@@ -4,7 +4,7 @@
module Twitter::Version #:nodoc:
MAJOR = 0
MINOR = 3
- REVISION = 0
+ REVISION = 1
class << self
# Returns X.Y.Z formatted version string
def to_version | Updated version to <I> | twitter4r_twitter4r-core | train | rb |
20ea047cf2b4c13951e57187b8d050dde23c99dc | diff --git a/master/buildbot/test/fake/latent.py b/master/buildbot/test/fake/latent.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/fake/latent.py
+++ b/master/buildbot/test/fake/latent.py
@@ -159,7 +159,9 @@ class ControllableLatentWorker(AbstractLatentWorker):
def stop_instance(self, build):
assert not self._controller.stopping
- assert self._controller.started or self._controller.starting
+ # TODO: we get duplicate stop_instance sometimes, this might indicate
+ # a bug in shutdown code path of AbstractWorkerController
+ # assert self._controller.started or self._controller.starting:
self._controller.started = False
self._controller.starting = False | test: Disable state asserts in fake latent worker shutdown path | buildbot_buildbot | train | py |
4033d9aa60ebd1f54ff555178ef2c685486f5f33 | diff --git a/modules/cms/src/menu/Item.php b/modules/cms/src/menu/Item.php
index <HASH>..<HASH> 100644
--- a/modules/cms/src/menu/Item.php
+++ b/modules/cms/src/menu/Item.php
@@ -369,11 +369,11 @@ class Item extends \yii\base\Object
*/
public function getParents()
{
- $parent = $this->getParent();
+ $parent = $this->with($this->_with)->getParent();
$data = [];
while ($parent) {
$data[] = $parent;
- $parent = $parent->getParent();
+ $parent = $parent->with($this->_with)->getParent();
}
return array_reverse($data);
@@ -391,18 +391,18 @@ class Item extends \yii\base\Object
}
/**
- * Return all parent elemtns **with** the current item.
+ * Return all parent elements **with** the current item.
*
* @return array An array with Item-Objects.
*/
public function getTeardown()
{
- $parent = $this->getParent();
+ $parent = $this->with($this->_with)->getParent();
$current = $this;
$data[$current->id] = $current;
while ($parent) {
$data[$parent->id] = $parent;
- $parent = $parent->getParent();
+ $parent = $parent->with($this->_with)->getParent();
}
return array_reverse($data, true); | added hidden listener to teardown and parents methods of cms menu
component. | luyadev_luya | train | php |
57b50427decdcd71b996222838a28bc50865c111 | diff --git a/packages/gluestick/src/autoUpgrade/checkForMismatch.js b/packages/gluestick/src/autoUpgrade/checkForMismatch.js
index <HASH>..<HASH> 100644
--- a/packages/gluestick/src/autoUpgrade/checkForMismatch.js
+++ b/packages/gluestick/src/autoUpgrade/checkForMismatch.js
@@ -62,7 +62,7 @@ const checkForMismatch = (
};
};
Object.keys(templatePackage.dependencies).forEach((dep: string): void => {
- if (dev && dep === 'gluestick' && !/\d\.\d\.\d.*/.test(projectPackage.dependencies[dep])) {
+ if (dev && dep === 'gluestick' && !/\d+\.\d+\.\d+.*/.test(projectPackage.dependencies[dep])) {
return;
}
if ( | Changed regex for gluestick version | TrueCar_gluestick | train | js |
9f7cef85ec8c0ddcce7d57fdad1f398bd10ce9d2 | diff --git a/symphony/lib/toolkit/class.field.php b/symphony/lib/toolkit/class.field.php
index <HASH>..<HASH> 100755
--- a/symphony/lib/toolkit/class.field.php
+++ b/symphony/lib/toolkit/class.field.php
@@ -101,11 +101,11 @@
return true;
}
- public function setFromPOST($postdata) {
- $postdata['location'] = (isset($postdata['location']) ? $postdata['location'] : 'main');
- $postdata['required'] = (isset($postdata['required']) ? 'yes' : 'no');
- $postdata['show_column'] = (isset($postdata['show_column']) ? 'yes' : 'no');
- $this->setArray($postdata);
+ public function setFromPOST($data) {
+ $data['location'] = (isset($data['location']) ? $data['location'] : 'main');
+ $data['required'] = (isset($data['show_column']) && @$data['required'] == 'yes' ? 'yes' : 'no');
+ $data['show_column'] = (isset($data['show_column']) && @$data['required'] == 'yes' ? 'yes' : 'no');
+ $this->setArray($data);
}
public function setArray($array){ | Fixed issue with required chechboxes loosing their state. | symphonycms_symphony-2 | train | php |
a083d222ac31323c2ecb22414fa5f7b397be279a | diff --git a/bitsharesbase/asset_permissions.py b/bitsharesbase/asset_permissions.py
index <HASH>..<HASH> 100644
--- a/bitsharesbase/asset_permissions.py
+++ b/bitsharesbase/asset_permissions.py
@@ -20,7 +20,7 @@ def toint(permissions):
permissions_int = 0
for p in permissions:
if permissions[p]:
- permissions_int += asset_permissions[p]
+ permissions_int |= asset_permissions[p]
return permissions_int | Use bitwise-or instead of addition for combining asset_permissions. | bitshares_python-bitshares | train | py |
c4ed7b80c5153bd06d082bf8c6f2f3247a959b05 | diff --git a/src/Illuminate/Queue/Connectors/SqsConnector.php b/src/Illuminate/Queue/Connectors/SqsConnector.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Queue/Connectors/SqsConnector.php
+++ b/src/Illuminate/Queue/Connectors/SqsConnector.php
@@ -13,9 +13,7 @@ class SqsConnector implements ConnectorInterface {
*/
public function connect(array $config)
{
- $sqsConfig = array_only($config, array('key', 'secret', 'region', 'default_cache_config'));
-
- $sqs = SqsClient::factory($sqsConfig);
+ $sqs = SqsClient::factory($config);
return new SqsQueue($sqs, $config['queue']);
} | Updated Queue SqsConnector to be able to support other AWS SDK options. | laravel_framework | train | php |
ca33d65fa1aa255617ec92665dc30cdd831c587f | diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py
index <HASH>..<HASH> 100644
--- a/astroid/__pkginfo__.py
+++ b/astroid/__pkginfo__.py
@@ -17,7 +17,7 @@
"""astroid packaging information"""
-version = "2.3.0"
+version = "2.3.0.dev0"
numversion = tuple(int(elem) for elem in version.split(".") if elem.isdigit())
extras_require = {} | Make the version a dev one for now | PyCQA_astroid | train | py |
4806eda45ae605bc5d58edd110c6a179576fa258 | diff --git a/src/Grant/AbstractGrant.php b/src/Grant/AbstractGrant.php
index <HASH>..<HASH> 100644
--- a/src/Grant/AbstractGrant.php
+++ b/src/Grant/AbstractGrant.php
@@ -246,7 +246,7 @@ abstract class AbstractGrant implements GrantTypeInterface
}
if (empty($validScopes)) {
- throw OAuthServerException::missingScope($redirectUri);
+ throw OAuthServerException::invalidScope($redirectUri);
}
return $validScopes; | Change to throw invalid scope instead of missing scope exception | thephpleague_oauth2-server | train | php |
1bc39d6ea82e20625b0c0a6fc052a6b59110ba61 | diff --git a/hazelcast/src/test/java/com/hazelcast/executor/ExecutorServiceTest.java b/hazelcast/src/test/java/com/hazelcast/executor/ExecutorServiceTest.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/test/java/com/hazelcast/executor/ExecutorServiceTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/executor/ExecutorServiceTest.java
@@ -231,7 +231,7 @@ public class ExecutorServiceTest extends HazelcastTestSupport {
}
service.submitToKeyOwner(new ScriptRunnable(script, map), key, callback);
}
- latch.await(10, TimeUnit.SECONDS);
+ assertOpenEventually(latch);
assertEquals(0, instances[0].getAtomicLong("testSubmitToKeyOwnerRunnable").get());
assertEquals(k, count.get());
}
@@ -263,7 +263,7 @@ public class ExecutorServiceTest extends HazelcastTestSupport {
map.put("member", instance.getCluster().getLocalMember());
service.submitToMember(new ScriptRunnable(script, map), instance.getCluster().getLocalMember(), callback);
}
- latch.await(10, TimeUnit.SECONDS);
+ assertOpenEventually(latch);
assertEquals(0, instances[0].getAtomicLong("testSubmitToMemberRunnable").get());
assertEquals(k, count.get());
} | use assertOpenEventually for latch in testSubmitToKeyOwnerRunnable | hazelcast_hazelcast | train | java |
a235dc906f05d5dcafbe55ba882289ac388cd91d | diff --git a/src/ol/events/EventTarget.js b/src/ol/events/EventTarget.js
index <HASH>..<HASH> 100644
--- a/src/ol/events/EventTarget.js
+++ b/src/ol/events/EventTarget.js
@@ -1,7 +1,6 @@
/**
* @module ol/events/EventTarget
*/
-import {inherits} from '../util.js';
import Disposable from '../Disposable.js';
import {unlistenAll} from '../events.js';
import {UNDEFINED} from '../functions.js';
@@ -29,12 +28,11 @@ import Event from '../events/Event.js';
* returns false.
*
* @constructor
- * @extends {module:ol/Disposable}
*/
-class EventTarget {
+class EventTarget extends Disposable {
constructor() {
- Disposable.call(this);
+ super();
/**
* @private
@@ -165,7 +163,5 @@ class EventTarget {
}
}
-inherits(EventTarget, Disposable);
-
export default EventTarget; | Use extends and super for events/EventTarget | openlayers_openlayers | train | js |
598e8339efecb493d79c98ca843a2cdf4ae0fbff | diff --git a/commerce-service/src/main/java/com/liferay/commerce/service/impl/CommerceShipmentServiceImpl.java b/commerce-service/src/main/java/com/liferay/commerce/service/impl/CommerceShipmentServiceImpl.java
index <HASH>..<HASH> 100644
--- a/commerce-service/src/main/java/com/liferay/commerce/service/impl/CommerceShipmentServiceImpl.java
+++ b/commerce-service/src/main/java/com/liferay/commerce/service/impl/CommerceShipmentServiceImpl.java
@@ -130,6 +130,10 @@ public class CommerceShipmentServiceImpl
List<CommerceChannel> commerceChannels =
_commerceChannelService.searchCommerceChannels(companyId);
+ if (commerceChannels.isEmpty()) {
+ return 0;
+ }
+
Stream<CommerceChannel> stream = commerceChannels.stream();
long[] commerceChannelGroupIds = stream.mapToLong( | EMP-<I> If there aren't any channels there aren't any shipments | liferay_com-liferay-commerce | train | java |
c43fc5cd5074decc20473924bd460cb8fa7fefb8 | diff --git a/tests/test_examples.py b/tests/test_examples.py
index <HASH>..<HASH> 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -38,7 +38,7 @@ def test_text_example():
def test_select_example():
- from examples.select import ask_dictstyle, ask_pystyle
+ from examples.select_example import ask_dictstyle, ask_pystyle
text = KeyInputs.DOWN + KeyInputs.ENTER + KeyInputs.ENTER + "\r" | Update test for select-example | tmbo_questionary | train | py |
7a196eb0afe417895a7ace38ad7b88812e913bac | diff --git a/classes/Pods.php b/classes/Pods.php
index <HASH>..<HASH> 100644
--- a/classes/Pods.php
+++ b/classes/Pods.php
@@ -791,6 +791,19 @@ class Pods implements Iterator {
$params->output = 'arrays';
}
+ $is_tableless_field_and_not_simple = (
+ ! $is_traversal
+ && $field_data
+ && ! $field_data instanceof Object_Field
+ && $is_tableless_field
+ && ! $field_data->is_simple_relationship()
+ );
+
+ // If a relationship is returned from the table as an ID but the parameter is not traversal, we need to run traversal logic.
+ if ( $is_tableless_field_and_not_simple && isset( $this->data->row[ $params->name ] ) && ! is_array( $this->data->row[ $params->name ] ) ) {
+ unset( $this->data->row[ $params->name ] );
+ }
+
// Enforce output type for tableless fields in forms.
if ( empty( $value ) && $is_tableless_field ) {
$params->raw = true; | For non-traversed tableless fields that are not simple and are not yet arrays, unset them from the row array | pods-framework_pods | train | php |
f54b53a942e9a98aab5dabd72669c4cdd372338e | diff --git a/src/main/java/skadistats/clarity/model/s2/S2CombatLogEntry.java b/src/main/java/skadistats/clarity/model/s2/S2CombatLogEntry.java
index <HASH>..<HASH> 100644
--- a/src/main/java/skadistats/clarity/model/s2/S2CombatLogEntry.java
+++ b/src/main/java/skadistats/clarity/model/s2/S2CombatLogEntry.java
@@ -17,7 +17,7 @@ public class S2CombatLogEntry implements CombatLogEntry {
}
private String readCombatLogName(int idx) {
- return idx == 0 ? null : combatLogNames.getNameByIndex(idx);
+ return idx <= 0 ? null : combatLogNames.getNameByIndex(idx);
}
@Override | return null when trying to read combat log names with negative indices (fixes #<I>) | skadistats_clarity | train | java |
47d0946b2850a53699ae7bde5ad931c6e92510ed | diff --git a/models/classes/theme/LtiThemeSwitcher.php b/models/classes/theme/LtiThemeSwitcher.php
index <HASH>..<HASH> 100644
--- a/models/classes/theme/LtiThemeSwitcher.php
+++ b/models/classes/theme/LtiThemeSwitcher.php
@@ -62,9 +62,11 @@ class LtiThemeSwitcher extends ThemeService implements LtiHeadless {
$launchData = $currentSession->getLaunchData();
if ($launchData->hasVariable(self::LTI_PRESENTATION_TARGET) && $launchData->getVariable(self::LTI_PRESENTATION_TARGET) == 'frame') {
return true;
+ } else {
+ return false;
}
}
- return false;
+ return true;
}
} | Fix logic of isHeadless | oat-sa_extension-tao-lti | train | php |
776ddd056d0ba7ee98a4789b22319a38a6d60a8c | diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -492,7 +492,7 @@ class Configuration implements ConfigurationInterface
->ifTrue(function($v) { return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['repository']); })
->thenInvalid('Propel doesn\'t support the "repository" parameter')
->ifTrue(function($v) { return isset($v['driver']) && 'orm' !== $v['driver'] && !empty($v['elastica_to_model_transformer']['hints']); })
- ->thenInvalid('Hints are only supported by "orm" driver')
+ ->thenInvalid('Hints are only supported by the "orm" driver')
->end()
->children()
->scalarNode('driver') | Dummy commit to re-run CI tests | FriendsOfSymfony_FOSElasticaBundle | train | php |
f42cb9dae27a235b1371ada777c38dfc5c57acd2 | diff --git a/uiautomation/uiautomation.py b/uiautomation/uiautomation.py
index <HASH>..<HASH> 100644
--- a/uiautomation/uiautomation.py
+++ b/uiautomation/uiautomation.py
@@ -85,7 +85,7 @@ class _DllClient:
binPath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "bin")
os.environ["PATH"] = binPath + os.pathsep + os.environ["PATH"]
load = False
- if sys.version >= '3.8':
+ if (sys.version_info[0] == 3 and sys.version_info[1] >= 8) or sys.version_info[0] > 3:
os.add_dll_directory(binPath)
if sys.maxsize > 0xFFFFFFFF:
try:
diff --git a/uiautomation/version.py b/uiautomation/version.py
index <HASH>..<HASH> 100644
--- a/uiautomation/version.py
+++ b/uiautomation/version.py
@@ -1 +1 @@
-VERSION = "2.0.15"
+VERSION = "2.0.16" | fix <I> can't load dll | yinkaisheng_Python-UIAutomation-for-Windows | train | py,py |
a4c2ef37b148f91496f48c0d7fca669801f45b44 | diff --git a/lxd/network/network_utils_ovn.go b/lxd/network/network_utils_ovn.go
index <HASH>..<HASH> 100644
--- a/lxd/network/network_utils_ovn.go
+++ b/lxd/network/network_utils_ovn.go
@@ -9,14 +9,14 @@ import (
// OVNInstanceDevicePortAdd adds a logical port to the OVN network's internal switch and returns the logical
// port name for use linking an OVS port on the integration bridge to the logical switch port.
-func OVNInstanceDevicePortAdd(network Network, instanceID int, deviceName string, mac net.HardwareAddr, ips []net.IP) (openvswitch.OVNSwitchPort, error) {
+func OVNInstanceDevicePortAdd(network Network, instanceID int, instanceName string, deviceName string, mac net.HardwareAddr, ips []net.IP) (openvswitch.OVNSwitchPort, error) {
// Check network is of type OVN.
n, ok := network.(*ovn)
if !ok {
return "", fmt.Errorf("Network is not OVN type")
}
- return n.instanceDevicePortAdd(instanceID, deviceName, mac, ips)
+ return n.instanceDevicePortAdd(instanceID, instanceName, deviceName, mac, ips)
}
// OVNInstanceDevicePortDelete deletes a logical port from the OVN network's internal switch. | lxd/network/network/utils/ovn: Updates OVNInstanceDevicePortAdd to take instanceName for DNS records | lxc_lxd | train | go |
16b75b7a10084ec50da8a1db73887e17de457673 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,10 @@ setup(
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers', | Update supported python versions | saltstack_salt-pylint | train | py |
cf069bfffe093f5e2b02a1a20813c74ccc1c2c64 | diff --git a/es6/element/react.js b/es6/element/react.js
index <HASH>..<HASH> 100644
--- a/es6/element/react.js
+++ b/es6/element/react.js
@@ -125,6 +125,18 @@ class ReactElement extends Element {
firstChild.clearAttribute(name);
}
+ addAttribute(name, value) {
+ const firstChild = first(this.children);
+
+ firstChild.setClassaddAttribute(name, value);
+ }
+
+ removeAttribute(name) {
+ const firstChild = first(this.children);
+
+ firstChild.removeAttribute(name)
+ }
+
setClass(className) {
const firstChild = first(this.children); | Added more methods to the React class. | djalbat_reaction | train | js |
ceace66cf03c5bb232c065ece3f6cf5a94ad0a81 | diff --git a/validators/__init__.py b/validators/__init__.py
index <HASH>..<HASH> 100644
--- a/validators/__init__.py
+++ b/validators/__init__.py
@@ -9,10 +9,10 @@ file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
from .chain import ReturnEarly, chainable, make_chain
from .validators import (required, optional, nonempty, boolean, istype, isin,
gte, lte, match, url, timestamp, deprecated,
- content_type, min_len, instanceof)
+ min_len, instanceof)
from .helpers import OR, NOT, spec_validator
__all__ = ['ReturnEarly', 'chainable', 'make_chain', 'required', 'optional',
'nonempty', 'boolean', 'istype', 'isin', 'gte', 'lte', 'match',
'url', 'timestamp', 'OR', 'NOT', 'spec_validator', 'deprecated',
- 'content_type', min_len, instanceof]
+ 'min_len', 'instanceof'] | fixed last instance of content_type sticking around | Othernet-Project_chainable-validators | train | py |
83e7d747ac1eca1f7e38e5924a6e942b1db39485 | diff --git a/src/TestRunner.js b/src/TestRunner.js
index <HASH>..<HASH> 100644
--- a/src/TestRunner.js
+++ b/src/TestRunner.js
@@ -119,9 +119,10 @@ TestRunner.prototype.runTest = function (browser, url) {
return job
.stop()
- // delete the timed out job otherwise the SauceLabs badge/status image would
- // indicate failure
- .then(function () { return job.del(); })
+ // Try to delete the timed out job in order to prevent the SauceLabs badge to
+ // indicate failure. The del() function can also fail, in that case swallow the
+ // exception.
+ .then(function () { return job.del().fail(_.noop); })
.then(getResult);
}
return result;
@@ -166,4 +167,4 @@ TestRunner.prototype.runTest = function (browser, url) {
});
};
-module.exports = TestRunner;
\ No newline at end of file
+module.exports = TestRunner; | If the DELETE command throws when the retry logic tries to delete the failed job, the exception is swallowed. | bytbil_gulp-saucelabs | train | js |
744f6d5704ae54a25f5bc7885a372b1468ff11ca | diff --git a/trunk/JLanguageTool/src/java/org/languagetool/rules/de/CaseRule.java b/trunk/JLanguageTool/src/java/org/languagetool/rules/de/CaseRule.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/java/org/languagetool/rules/de/CaseRule.java
+++ b/trunk/JLanguageTool/src/java/org/languagetool/rules/de/CaseRule.java
@@ -178,6 +178,7 @@ public class CaseRule extends GermanRule {
exceptions.add("Nähten");
exceptions.add("Neuem");
exceptions.add("Nr");
+ exceptions.add("Nutze"); // zu Nutze
exceptions.add("Obdachloser");
exceptions.add("Oder"); // der Fluss
exceptions.add("Patsche"); | [de] CaseRule: added exceptions "Nutze" | languagetool-org_languagetool | train | java |
4754e4aabbf9488828d86ecc774ebed768d24053 | diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js
index <HASH>..<HASH> 100644
--- a/lib/browser/guest-view-manager.js
+++ b/lib/browser/guest-view-manager.js
@@ -179,6 +179,7 @@ var attachGuest = function (embedder, elementInstanceId, guestInstanceId, params
guestInstanceId: guestInstanceId,
nodeIntegration: (ref1 = params.nodeintegration) != null ? ref1 : false,
plugins: params.plugins,
+ zoomFactor: params.zoomFactor,
webSecurity: !params.disablewebsecurity,
blinkFeatures: params.blinkfeatures
}
diff --git a/lib/renderer/web-view/web-view.js b/lib/renderer/web-view/web-view.js
index <HASH>..<HASH> 100644
--- a/lib/renderer/web-view/web-view.js
+++ b/lib/renderer/web-view/web-view.js
@@ -223,7 +223,8 @@ var WebViewImpl = (function () {
var attribute, attributeName, css, elementRect, params, ref1
params = {
instanceId: this.viewInstanceId,
- userAgentOverride: this.userAgentOverride
+ userAgentOverride: this.userAgentOverride,
+ zoomFactor: webFrame.getZoomFactor()
}
ref1 = this.attributes
for (attributeName in ref1) { | Add zoomFactor to guest params | electron_electron | train | js,js |
814bf76f83670cca75914d8cd88eee413e2024b7 | diff --git a/holoviews/operation/element.py b/holoviews/operation/element.py
index <HASH>..<HASH> 100644
--- a/holoviews/operation/element.py
+++ b/holoviews/operation/element.py
@@ -12,17 +12,18 @@ from ..element.tabular import ItemTable
class chain(ElementOperation):
"""
- Definining a viewoperation chain is an easy way to define a new
- ElementOperation from a series of existing ones. The single argument
- is a callable that accepts an input element and returns a list of
- output views. To create the custom ElementOperation, you will need to
- supply this argument to a new instance of chain. For example:
-
- chain.instance(chain=lambda x: [cmap2rgb(operator(x).N, cmap='jet')])
-
- This is now a ElementOperation that sums the data in the input
- overlay and turns it into an RGB Matrix with the 'jet'
- colormap.
+ Defining an ElementOperation chain is an easy way to define a new
+ ElementOperation from a series of existing ones. The single
+ argument is a callable that accepts an input element and returns
+ the final, transformed element. To create the custom
+ ElementOperation, you will need to supply this argument to a new
+ instance of chain. For example:
+
+ chain.instance(
+ chain=lambda x: colormap(operator(x, operator=np.add), cmap='jet'))
+
+ This defines an ElementOperation that sums the data in the input
+ and turns it into an RGB Matrix using the 'jet' colormap.
"""
chain = param.Callable(doc="""A chain of existing ViewOperations.""") | Updated the docstring for the chain ElementOperation | pyviz_holoviews | train | py |
1ecdd11008e4ea8228b307c0f41f72e99cd8ce74 | diff --git a/lib/payson_api.rb b/lib/payson_api.rb
index <HASH>..<HASH> 100644
--- a/lib/payson_api.rb
+++ b/lib/payson_api.rb
@@ -1,6 +1,5 @@
required_files = [
'config',
- 'error_codes',
'client',
'envelope',
'funding', | Bug fix: There is no such file | stoffus_payson_api | train | rb |
16adc7d27c8e8abf1cabd430dd1b7283c32a6b15 | diff --git a/client/api.go b/client/api.go
index <HASH>..<HASH> 100644
--- a/client/api.go
+++ b/client/api.go
@@ -23,6 +23,7 @@ import (
"github.com/stripe/stripe-go/invoiceitem"
"github.com/stripe/stripe-go/order"
"github.com/stripe/stripe-go/orderreturn"
+ "github.com/stripe/stripe-go/paymentsource"
"github.com/stripe/stripe-go/plan"
"github.com/stripe/stripe-go/product"
"github.com/stripe/stripe-go/recipient"
@@ -33,7 +34,6 @@ import (
"github.com/stripe/stripe-go/sub"
"github.com/stripe/stripe-go/token"
"github.com/stripe/stripe-go/transfer"
- "github.com/stripe/stripe-go/paymentsource"
)
// API is the Stripe client. It contains all the different resources available. | ran gofmt on api.go | stripe_stripe-go | train | go |
98863d6f70379b08777dd97a2fe773550b335661 | diff --git a/tests/test_indicators.py b/tests/test_indicators.py
index <HASH>..<HASH> 100644
--- a/tests/test_indicators.py
+++ b/tests/test_indicators.py
@@ -122,7 +122,13 @@ def test_identifier():
def test_formatting(pr_series):
out = atmos.wetdays(pr_series(np.arange(366)), thresh=1.0 * units.mm / units.day)
- assert out.attrs["long_name"] == "Number of wet days (precip >= 1 mm/day)"
-
+ # pint 0.10 now pretty print day as d.
+ assert out.attrs["long_name"] in [
+ "Number of wet days (precip >= 1 mm/day)",
+ "Number of wet days (precip >= 1 mm/d)",
+ ]
out = atmos.wetdays(pr_series(np.arange(366)), thresh=1.5 * units.mm / units.day)
- assert out.attrs["long_name"] == "Number of wet days (precip >= 1.5 mm/day)"
+ assert out.attrs["long_name"] in [
+ "Number of wet days (precip >= 1.5 mm/day)",
+ "Number of wet days (precip >= 1.5 mm/d)",
+ ] | Remodified tests that were modified in #<I>
I inadvertly removed the changes in my the last master merge into this branch. | Ouranosinc_xclim | train | py |
802c5534e8a18a39109a35ec7806277b298593e4 | diff --git a/angr/storage/memory_mixins/paged_memory/pages/list_page.py b/angr/storage/memory_mixins/paged_memory/pages/list_page.py
index <HASH>..<HASH> 100644
--- a/angr/storage/memory_mixins/paged_memory/pages/list_page.py
+++ b/angr/storage/memory_mixins/paged_memory/pages/list_page.py
@@ -82,7 +82,8 @@ class ListPage(MemoryObjectMixin, PageBase):
self.sinkhole = data
self.content = [None]*len(self.content)
else:
- for subaddr in range(addr, addr + size):
+ max_addr = min(addr + size, len(self.content))
+ for subaddr in range(addr, max_addr):
self.content[subaddr] = data
self.stored_offset.add(subaddr) | ListPage: Fix an issue of over-storing. (#<I>) | angr_angr | train | py |
732b3fb3b4bae921a32d2ff98a5146d84eb26461 | diff --git a/xod-client/src/user/enhancer.js b/xod-client/src/user/enhancer.js
index <HASH>..<HASH> 100644
--- a/xod-client/src/user/enhancer.js
+++ b/xod-client/src/user/enhancer.js
@@ -80,6 +80,7 @@ export const authEnhancer = next => (reducer, initialState, enhancer) => {
initialState = undefined; // eslint-disable-line
}
+ let gettingDataRequest = false;
let persistedState;
let finalInitialState;
@@ -96,6 +97,7 @@ export const authEnhancer = next => (reducer, initialState, enhancer) => {
// On init: check authorization
if (hasToGetUserData(finalInitialState)) {
getUserData(store.dispatch);
+ gettingDataRequest = true;
}
// On change: write / delete cookies
@@ -129,11 +131,13 @@ export const authEnhancer = next => (reducer, initialState, enhancer) => {
const processes = getProccesses(state);
const gettingUserData = R.pipe(
filterNotFinished,
- findProcessByType(type)
+ findProcessByType(type),
+ notNil
)(processes);
- if (hasToGetUserData(state) && !gettingUserData) {
+ if (hasToGetUserData(state) && !gettingUserData && gettingDataRequest === false) {
getUserData(store.dispatch);
+ gettingDataRequest = true;
}
}); | fix(client-auth): fix repeating requests | xodio_xod | train | js |
7ea3a481e254cc456de0a6162179213dc7147cb7 | diff --git a/fscache.go b/fscache.go
index <HASH>..<HASH> 100644
--- a/fscache.go
+++ b/fscache.go
@@ -27,6 +27,7 @@ type Cache struct {
// in it are loaded into the cache using their filename as their key.
// expiry is the # of hours after which an un-accessed key will be
// removed from the cache.
+// an expiry of 0 means never expire.
func New(dir string, mode os.FileMode, expiry int) (*Cache, error) {
err := os.MkdirAll(dir, mode)
if err != nil {
@@ -41,7 +42,9 @@ func New(dir string, mode os.FileMode, expiry int) (*Cache, error) {
if err != nil {
return nil, err
}
- c.reaper()
+ if expiry > 0 {
+ c.reaper()
+ }
return c, nil
} | expiry of 0 = never expire | djherbis_fscache | train | go |
488656491d9de95a068006f0acfa35afbac8902e | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012052200.00; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2012052200.01; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes | MDL-<I> webservice: version bump to pickup new string | moodle_moodle | train | php |
5341770765a7de325d9b144c20ad3943057520ce | diff --git a/lib/epubinfo.rb b/lib/epubinfo.rb
index <HASH>..<HASH> 100644
--- a/lib/epubinfo.rb
+++ b/lib/epubinfo.rb
@@ -5,7 +5,7 @@ require 'epubinfo/parser'
require 'epubinfo/model'
module EPUBInfo
- def self.parse(path)
-
+ def self.get(path)
+ parser = EPUBInfo::Parser.parse(path)
end
end
diff --git a/spec/lib/epubinfo_spec.rb b/spec/lib/epubinfo_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/epubinfo_spec.rb
+++ b/spec/lib/epubinfo_spec.rb
@@ -1,8 +1,13 @@
require 'spec_helper'
describe EPUBInfo do
- describe '#parse' do
-
+ let(:epub_path) { File.expand_path('spec/support/binary/metamorphosis.epub') }
+
+ describe '#get' do
+ it 'calls parser' do
+ EPUBInfo::Parser.should_receive(:parse)
+ EPUBInfo.get(epub_path)
+ end
end
end | Changed EPUBInfo API to support get call | chdorner_epubinfo | train | rb,rb |
440e9746bac32f7314c90f1cbeddc7749d8357c2 | diff --git a/releaf-content/spec/lib/acts_as_node_spec.rb b/releaf-content/spec/lib/acts_as_node_spec.rb
index <HASH>..<HASH> 100644
--- a/releaf-content/spec/lib/acts_as_node_spec.rb
+++ b/releaf-content/spec/lib/acts_as_node_spec.rb
@@ -48,7 +48,7 @@ describe ActsAsNode do
end
it "returns relation" do
- expect(Book.nodes.class).to eq(ActiveRecord::Relation::ActiveRecord_Relation_Node)
+ expect(Book.nodes.class).to eq(Node::ActiveRecord_Relation)
end
end
end
@@ -67,7 +67,7 @@ describe ActsAsNode do
end
it "returns array" do
- expect(ContactFormController.nodes.class).to eq(ActiveRecord::Relation::ActiveRecord_Relation_Node)
+ expect(ContactFormController.nodes.class).to eq(Node::ActiveRecord_Relation)
end
end
end | Rails<I> relationship names changes | cubesystems_releaf | train | rb |
887c4bda1219b9d59ddd52604a6d535a01681e94 | diff --git a/scripts/validate_r_cmd_check_output.py b/scripts/validate_r_cmd_check_output.py
index <HASH>..<HASH> 100644
--- a/scripts/validate_r_cmd_check_output.py
+++ b/scripts/validate_r_cmd_check_output.py
@@ -77,7 +77,8 @@ class Check:
r"^Package has FOSS license, installs .class/.jar but has no 'java' directory.",
r"^\* DONE",
-
+
+ r"^The Date field is over a month old.*",
r"^Checking URLs requires 'libcurl' support in the R build",
] | add valid expression to list of accepted R CMD check outputs. | h2oai_h2o-3 | train | py |
00064fd7cb301e755265202e94e6c1c8c081503f | diff --git a/pyphenomd.py b/pyphenomd.py
index <HASH>..<HASH> 100644
--- a/pyphenomd.py
+++ b/pyphenomd.py
@@ -138,7 +138,7 @@ class PhenomDWaveforms:
if len(np.where(self.st<self.et)[0]) != 0:
raise Exception("Start Time is less than End time.")
- if any(self.m1/self.m2 > 1e4) or any(self.m1/self.m2 < 1e-4):
+ if any(self.m1/self.m2 > 1.0) or any(self.m1/self.m2 < 9.999999e-5):
raise Exception("Mass Ratio too far from unity.")
return | mass ratio sanity check fixed | mikekatz04_BOWIE | train | py |
3ee8703317edf21aaff12c4aa7526152b07bb29b | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -29,11 +29,11 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2015050500.01; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2015050800.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
-$release = '2.9rc1 (Build: 20150505)'; // Human-friendly version name
+$release = '2.9rc2 (Build: 20150508)'; // Human-friendly version name
$branch = '29'; // This version's branch.
$maturity = MATURITY_RC; // This version's maturity level. | Moodle release <I>rc2 | moodle_moodle | train | php |
68ebc82b71c67e0350bbc551dd33edb44b166024 | diff --git a/lib/ProviderAws.js b/lib/ProviderAws.js
index <HASH>..<HASH> 100644
--- a/lib/ProviderAws.js
+++ b/lib/ProviderAws.js
@@ -262,12 +262,11 @@ module.exports = function(S) {
*/
getProfile(awsProfile, optional) {
- let profile = awsProfile.toLowerCase(),
- profiles = this.getAllProfiles();
- if (!optional && !profiles[profile]) {
- throw new SError(`Cant find profile ${profile} in ~/.aws/credentials`, profile);
+ let profiles = this.getAllProfiles();
+ if (!optional && !profiles[awsProfile]) {
+ throw new SError(`Cant find profile ${profile} in ~/.aws/credentials`, awsProfile);
}
- return profiles[profile];
+ return profiles[awsProfile];
}
getLambdasStackName(stage, projectName) { | Removing code to make the profile name lowercase, as this prevents a match for any profiles with uppercase letters. | serverless_serverless | train | js |
ba14d40b7cfdaa25cbdd67b98c099b9b6adee8e4 | diff --git a/public/src/Conn/Read.php b/public/src/Conn/Read.php
index <HASH>..<HASH> 100644
--- a/public/src/Conn/Read.php
+++ b/public/src/Conn/Read.php
@@ -67,7 +67,7 @@ class Read extends Conn
$termos = parent::addLogicMajor($termos ?? "", $this->tabela, $info, $ignoreSystem !== null);
if(!empty($info['password']) && $this->select === "*" && !empty($info['columns_readable']))
- $this->select = implode(", ", $info['columns_readable']);
+ $this->select = implode(", ", $info['columns_readable']) . ($info['user'] === 1 ? ", usuarios_id" : ""). ($info['autor'] === 1 ? ", autorpub" : ""). ($info['autor'] === 2 ? ", ownerpub" : "");
$this->sql = "SELECT {$this->select} FROM {$this->tabela} {$termos}";
$this->execute(); | read select include usuarios_id, autorpub, ownerpub | edineibauer_uebConn | train | php |
2934f540f2c84f23a4fd5b9c3e4ebc73e59628de | diff --git a/cassandra_test.go b/cassandra_test.go
index <HASH>..<HASH> 100644
--- a/cassandra_test.go
+++ b/cassandra_test.go
@@ -656,6 +656,11 @@ func TestBoundQueryInfo(t *testing.T) {
}
func TestBatchQueryInfo(t *testing.T) {
+
+ if *flagProto == 1 {
+ t.Skip("atomic batches not supported. Please use Cassandra >= 2.0")
+ }
+
session := createSession(t)
defer session.Close() | Batches are not supported so well in Cassandra 1.x | gocql_gocql | train | go |
54e64e133d10c2b5b979d57efac7a755e0cf8141 | diff --git a/src/ElephantOnCouch/Info/DbInfo.php b/src/ElephantOnCouch/Info/DbInfo.php
index <HASH>..<HASH> 100755
--- a/src/ElephantOnCouch/Info/DbInfo.php
+++ b/src/ElephantOnCouch/Info/DbInfo.php
@@ -144,8 +144,8 @@ class DbInfo {
$buffer .= "File Opened Since: ".sprintf($since, $time['days'], $time['hours'], $time['minutes'], $time['seconds']).PHP_EOL;
}
- $buffer .= "Disk Size (Bytes): ".$this->diskSize.PHP_EOL;
- $buffer .= "Data Size (Bytes): ".$this->dataSize.PHP_EOL;
+ $buffer .= "Disk Size: ".$this->diskSize/(1024*1024*1024)." GB".PHP_EOL;
+ $buffer .= "Data Size: ".$this->dataSize/(1024*1024*1024)." GB".PHP_EOL;
$buffer .= "Disk Format Version: ".$this->diskFormatVersion.PHP_EOL;
$compactRunning = ($this->compactRunning) ? 'active' : 'inactive'; | now Data Size and Disk Size are expressed as GB | dedalozzo_eoc-client | train | php |
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.