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
|
---|---|---|---|---|---|
5f14f3e896ee217d6e8f8681ae30e44b0ee4501d | diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-pe/version.rb
+++ b/lib/beaker-pe/version.rb
@@ -3,7 +3,7 @@ module Beaker
module PE
module Version
- STRING = '2.10.11'
+ STRING = '2.11.0'
end
end | (GEM) update beaker-pe version to <I> | puppetlabs_beaker-pe | train | rb |
098d71a8df33c653fac9cf57ebd7d769024c8f0a | diff --git a/jre_emul/apache_harmony/classlib/modules/luni/src/main/java/java/util/LinkedList.java b/jre_emul/apache_harmony/classlib/modules/luni/src/main/java/java/util/LinkedList.java
index <HASH>..<HASH> 100644
--- a/jre_emul/apache_harmony/classlib/modules/luni/src/main/java/java/util/LinkedList.java
+++ b/jre_emul/apache_harmony/classlib/modules/luni/src/main/java/java/util/LinkedList.java
@@ -54,7 +54,7 @@ public class LinkedList<E> extends AbstractSequentialList<E> implements
final LinkedList<ET> list;
- Link<ET> link, lastLink;
+ @Weak Link<ET> link, lastLink;
LinkIterator(LinkedList<ET> object, int location) {
list = object; | Makes link references weak in the LinkedList iterator to improve performance. | google_j2objc | train | java |
4e9381e40e135c833eb90daa0dca8a54012fea6f | diff --git a/lib/crawler.js b/lib/crawler.js
index <HASH>..<HASH> 100644
--- a/lib/crawler.js
+++ b/lib/crawler.js
@@ -340,10 +340,10 @@ Crawler.prototype.processURL = function(URL,context) {
/*
Public: Discovers linked resources in an HTML, XML or text document.
- resourceData - String containing document with linked resources.
- queueItem - Queue item corresponding to document being searched.
- decompressed - The data being passed in has already been decompressed.
- Don't try again.
+ resourceData - String containing document with linked resources.
+ queueItem - Queue item corresponding to document being searched.
+ decompressed - The data being passed in has already been decompressed.
+ Don't try again.
Examples | Fixed spaces vs tabs stupidity in inline documentation. | simplecrawler_simplecrawler | train | js |
5947e50e2b79d1eaf37e7aaf55912de68ea80e1a | diff --git a/src/WordpressClient.php b/src/WordpressClient.php
index <HASH>..<HASH> 100644
--- a/src/WordpressClient.php
+++ b/src/WordpressClient.php
@@ -724,7 +724,7 @@ class WordpressClient
$this->_setXmlrpcType($params);
$this->_request = xmlrpc_encode_request($method, $params, array('encoding' => 'UTF-8', 'escaping' => 'markup'));
$body = "";
- if (function_exists('curl_init'))
+ if (false && function_exists('curl_init'))
{
$body = $this->_requestWithCurl();
}
@@ -833,7 +833,7 @@ class WordpressClient
{
$contextOptions = array('http' => array(
'method' => "POST",
- 'header' => "Content-Type: text/xml\r\n",
+ 'header' => "Content-Type: text/xml\r\nUser-Agent: PHP/" . phpversion() . "\r\n",
'content' => $this->_request
)); | Added User-Agent header to requests without cURL
Added User-Agent header to requests without cURL as WordPress.com blogs
now
require this to be set before accepting an XML-RPC request. | letrunghieu_wordpress-xmlrpc-client | train | php |
b6de71c2a6b10d6395635fdcd7857eef359be96b | diff --git a/packages/ember-metal/lib/events.js b/packages/ember-metal/lib/events.js
index <HASH>..<HASH> 100644
--- a/packages/ember-metal/lib/events.js
+++ b/packages/ember-metal/lib/events.js
@@ -128,7 +128,7 @@ function addListener(obj, eventName, target, method, xform) {
}
var actionSet = actionSetFor(obj, eventName, target, true),
- methodGuid = guidFor(method), ret;
+ methodGuid = guidFor(method);
if (!actionSet[methodGuid]) {
actionSet[methodGuid] = { target: target, method: method, xform: xform };
@@ -139,8 +139,6 @@ function addListener(obj, eventName, target, method, xform) {
if ('function' === typeof obj.didAddListener) {
obj.didAddListener(eventName, target, method);
}
-
- return ret; // return true if this is the first listener.
}
/** @memberOf Ember */ | Cleaned up unused variable and incorrect comment - fixes #<I> | emberjs_ember.js | train | js |
4e90708d14f678dbdab30814e16c51c5233bcedd | diff --git a/tests/test_connection.py b/tests/test_connection.py
index <HASH>..<HASH> 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -167,7 +167,7 @@ class TestConnection(XcffibTest):
utf8_string = self.intern("UTF8_STRING")
title_bytes = b"test\xc2\xb7"
- title_string = u"test\u00B7"
+ title_string = six.u("test\u00B7")
# First check with an object already encoded as bytes
self.xproto.ChangeProperty(xcffib.xproto.PropMode.Replace, wid, | Forgot about u not working in <I> | tych0_xcffib | train | py |
6850acd262f8cb510ed0433d4ad651915cc31fa3 | diff --git a/telegram_send/telegram_send.py b/telegram_send/telegram_send.py
index <HASH>..<HASH> 100644
--- a/telegram_send/telegram_send.py
+++ b/telegram_send/telegram_send.py
@@ -395,7 +395,7 @@ def configure(conf, channel=False, group=False, fm_integration=False):
print("\nOpen https://web.telegram.org in your browser, sign in and open your private channel."
"\nNow copy the URL in the address bar and enter it here:")
url = input(markup(prompt, "magenta")).strip()
- chat_id = "-100" + re.match(r".+web\.telegram\.org\/#\/im\?p=c(\d+)", url).group(1)
+ chat_id = "-100" + re.match(r".+web\.(telegram|tlgr)\.org\/#\/im\?p=c(\d+)", url).group(2)
authorized = False
while not authorized: | Accomodate alternate telegram web url in configuration. | rahiel_telegram-send | train | py |
e9fa7e5389d99100828eebe6d5efa30fd31dbbb3 | diff --git a/src/java/com/threerings/gwt/ui/Widgets.java b/src/java/com/threerings/gwt/ui/Widgets.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/gwt/ui/Widgets.java
+++ b/src/java/com/threerings/gwt/ui/Widgets.java
@@ -96,6 +96,26 @@ public class Widgets
}
/**
+ * Wraps the supplied contents in a scroll panel with the specified maximum width.
+ */
+ public static ScrollPanel newScrollPanelX (Widget contents, int maxWidth)
+ {
+ ScrollPanel panel = new ScrollPanel(contents);
+ DOM.setStyleAttribute(panel.getElement(), "maxWidth", maxWidth + "px");
+ return panel;
+ }
+
+ /**
+ * Wraps the supplied contents in a scroll panel with the specified maximum height.
+ */
+ public static ScrollPanel newScrollPanelY (Widget contents, int maxHeight)
+ {
+ ScrollPanel panel = new ScrollPanel(contents);
+ DOM.setStyleAttribute(panel.getElement(), "maxHeight", maxHeight + "px");
+ return panel;
+ }
+
+ /**
* Creates a row of widgets in a horizontal panel with a 5 pixel gap between them.
*/
public static HorizontalPanel newRow (Widget... contents) | Added newScrollPanelX/Y. | threerings_gwt-utils | train | java |
c72a4f99c5918258345c7c46fe641667a3f40111 | diff --git a/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java b/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java
index <HASH>..<HASH> 100644
--- a/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java
+++ b/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java
@@ -355,7 +355,10 @@ public final class AutoML extends Lockable<AutoML> implements TimedH2ORunnable {
if (null == this.trainingFrame) {
// when nfolds>0, let trainingFrame be the original frame
- this.trainingFrame = origTrainingFrame;
+ // but cloning to keep an internal ref just in case the original ref gets deleted from client side
+ // (can occur in some corner cases with Python GC for example if frame get's out of scope during an AutoML rerun)
+ this.trainingFrame = new Frame(origTrainingFrame);
+ DKV.put(this.trainingFrame);
}
this.responseColumn = trainingFrame.vec(buildSpec.input_spec.response_column); | Cloning passed training frame in AutoML to keep internal ref. in case of reruns | h2oai_h2o-3 | train | java |
3589ff6f2c1de1f9086c3a954f944ffef6781d53 | diff --git a/js-test/test.js b/js-test/test.js
index <HASH>..<HASH> 100644
--- a/js-test/test.js
+++ b/js-test/test.js
@@ -887,4 +887,22 @@
createStore({ loadUrl: "/"}).load();
})
}
+
+ QUnit.test("T903595 - body encoding", function(assert) {
+ var done = assert.async();
+
+ XHRMock.use(function(req) {
+ assert.ok(!("values" in req.url().query));
+ assert.equal(req.body(), "values=%7B%22a%22%3A1%7D");
+ done();
+ return NEVER_RESOLVE
+ });
+
+ var store = createStore({
+ key: "any",
+ insertUrl: "/"
+ });
+
+ store.insert({ a: 1 });
+ });
}); | Add test for HTTP body encoding
Partial pick of f<I>d2b5 | DevExpress_DevExtreme.AspNet.Data | train | js |
956da89dd1b32b1399b937ec123cd3f12f941daf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ setup(
'frigg-settings>=1.1.1,<2.0.0',
'docker-wrapper>=2.1,<2.2', # rq.filter: <2.0
'pyyaml==3.11',
- 'requests>=2.0.0,<3.0.0',
+ 'requests>=2.8.1,<3.0.0',
'raven==5.7.2'
],
entry_points={ | Upgrade dependency requests to >=<I>,<<I> | frigg_frigg-worker | train | py |
dcd54c599257d00945a13163b49640a50d2723d2 | diff --git a/frontends/default/javascripts/jquery/active_scaffold.js b/frontends/default/javascripts/jquery/active_scaffold.js
index <HASH>..<HASH> 100644
--- a/frontends/default/javascripts/jquery/active_scaffold.js
+++ b/frontends/default/javascripts/jquery/active_scaffold.js
@@ -632,6 +632,7 @@ var ActiveScaffold = {
toggler.children('a').click(function() {
toggable.toggle();
$(this).html((toggable.is(':hidden')) ? options.show_label : options.hide_label);
+ return false;
});
},
diff --git a/frontends/default/javascripts/prototype/active_scaffold.js b/frontends/default/javascripts/prototype/active_scaffold.js
index <HASH>..<HASH> 100644
--- a/frontends/default/javascripts/prototype/active_scaffold.js
+++ b/frontends/default/javascripts/prototype/active_scaffold.js
@@ -512,6 +512,7 @@ var ActiveScaffold = {
var element = event.element();
toggable.toggle();
element.innerHTML = (toggable.style.display == 'none') ? options.show_label : options.hide_label;
+ return false;
});
}, | Ensure hide/show buttons don't bring you to top of the page.
return false for the toggler click callback functions so they
don't bring you to the top of the page. | activescaffold_active_scaffold | train | js,js |
bf45c176a7e623cc4b036c895966062e47711f2a | diff --git a/spec/unit/crypto.spec.js b/spec/unit/crypto.spec.js
index <HASH>..<HASH> 100644
--- a/spec/unit/crypto.spec.js
+++ b/spec/unit/crypto.spec.js
@@ -324,14 +324,8 @@ describe("Crypto", function() {
expect(aliceClient.sendToDevice).toBeCalledTimes(1);
const txnId = aliceClient.sendToDevice.mock.calls[0][2];
- // give the room key request manager time to update the state
- // of the request
- await Promise.resolve();
-
// cancel and resend the room key request
await aliceClient.cancelAndResendEventRoomKeyRequest(event);
- jest.runAllTimers();
- await Promise.resolve();
// cancelAndResend will call sendToDevice twice:
// the first call to sendToDevice will be the cancellation
// the second call to sendToDevice will be the key request | get rid of bunch of seemingly pointless waits | matrix-org_matrix-js-sdk | train | js |
5f7cc9b7f70ece9dfb2fd5e9a629c1f2b4d1e6c7 | diff --git a/yaas-cart.js b/yaas-cart.js
index <HASH>..<HASH> 100644
--- a/yaas-cart.js
+++ b/yaas-cart.js
@@ -15,6 +15,10 @@ var Cart = function(rh) {
return this.requestHelper.post(pathCartBase, 'application/json', cart);
};
+ this.get = function(cartId) {
+ return this.requestHelper.get(pathCartBase + '/' + cartId);
+ };
+
this.deleteCart = function(cartId) {
return this.requestHelper.delete(pathCartBase + '/' + cartId);
}; | Added get cart by id | SAP_yaas-nodejs-client-sdk | train | js |
7d6c784a67935a03d87edefae82b2090f1caaaaf | diff --git a/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java b/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java
index <HASH>..<HASH> 100644
--- a/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java
+++ b/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java
@@ -75,7 +75,17 @@ public class NettyNetworkService implements NetworkService {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
logger.debug("channel read");
- if (listener != null) listener.onRead(this, ((ByteBuf)msg).nioBuffer());
+ // Make a copy of the buffer
+ // TODO: this is inefficient - support for pooling should be integrated into
+ // the interfaces that define a network service...
+ if (listener != null) {
+ ByteBuf buf = ((ByteBuf)msg);
+ ByteBuffer nioBuf = ByteBuffer.allocate(buf.readableBytes());
+ buf.readBytes(nioBuf);
+ nioBuf.flip();
+ listener.onRead(this, nioBuf);
+ buf.release();
+ }
}
@Override | Make a copy of the pooled ByteBuf in the network code | mqlight_java-mqlight | train | java |
bf3b524851a8600420d13880f3d8633c99955fd2 | diff --git a/lib/netuitived/metric_aggregator.rb b/lib/netuitived/metric_aggregator.rb
index <HASH>..<HASH> 100644
--- a/lib/netuitived/metric_aggregator.rb
+++ b/lib/netuitived/metric_aggregator.rb
@@ -55,7 +55,7 @@ module NetuitiveD
end
unless NetuitiveD::ConfigManager.elementTags.nil?
@tags = []
- for tag in NetuitiveD::ConfigManager.elementTags.split(',').map(&:strip) do
+ NetuitiveD::ConfigManager.elementTags.split(',').map(&:strip).each do |tag|
@tags.push(NetuitiveD::IngestTag.new(tag.split(':')[0], tag.split(':')[1]))
end
end | Changing for loop to each loop per rubocop recommendation | Netuitive_netuitived | train | rb |
50157863070f6def43f9dc6f1cc8fe180161c5ca | diff --git a/bundles/ring-jetbrains-confluence.js b/bundles/ring-jetbrains-confluence.js
index <HASH>..<HASH> 100644
--- a/bundles/ring-jetbrains-confluence.js
+++ b/bundles/ring-jetbrains-confluence.js
@@ -10,6 +10,7 @@ define([
var header = ring('header');
var init = header('init', null, '.ring-header', 'replace');
+ var PERSONAL_SELECTOR = '.ring-header__personal';
// Render header
$(function(){
@@ -23,7 +24,7 @@ define([
init.done(function() {
header('update', 'user.name', $username.text());
- $('.ring-header__personal').on('click.ring-personal', function() {
+ $(document).on('click.ring-personal', PERSONAL_SELECTOR, function() {
$username.click();
});
}); | RG-<I> Ring header: confluence profile link is not working from time to time
Former-commit-id: dc<I>b<I>d3d<I>a<I>e<I>eea0d<I>ab<I> | JetBrains_ring-ui | train | js |
7496722fd9306e19c40410605b642e2b833c8f2f | diff --git a/django_extensions/tests/test_dumpscript.py b/django_extensions/tests/test_dumpscript.py
index <HASH>..<HASH> 100644
--- a/django_extensions/tests/test_dumpscript.py
+++ b/django_extensions/tests/test_dumpscript.py
@@ -12,13 +12,16 @@ class DumpScriptTests(TestCase):
self.real_stdout = sys.stdout
sys.stdout = StringIO()
- settings.INSTALLED_APPS += ('django_extensions.tests',)
+ self.original_installed_apps = settings.INSTALLED_APPS
+ settings.INSTALLED_APPS = list(settings.INSTALLED_APPS)
+ settings.INSTALLED_APPS.append('django_extensions.tests')
loading.cache.loaded = False
call_command('syncdb', verbosity=0)
def tearDown(self):
sys.stdout = self.real_stdout
- settings.INSTALLED_APPS.pop()
+ settings.INSTALLED_APPS.remove('django_extensions.tests')
+ settings.INSTALLED_APPS = self.original_installed_apps
loading.cache.loaded = False
def test_runs(self):
@@ -27,3 +30,4 @@ class DumpScriptTests(TestCase):
n.save()
call_command('dumpscript', 'tests')
self.assertTrue('Gabriel' in sys.stdout.getvalue())
+ | ticket #<I> make sure INSTALLED_APPS is cohersed into a list and reset the original INSTALLED_APPS on teardown | django-extensions_django-extensions | train | py |
38c3a7c134d0e504965649b8a5b170142b392990 | diff --git a/src/Support/Container/LaravelContainerDecorator.php b/src/Support/Container/LaravelContainerDecorator.php
index <HASH>..<HASH> 100644
--- a/src/Support/Container/LaravelContainerDecorator.php
+++ b/src/Support/Container/LaravelContainerDecorator.php
@@ -50,7 +50,7 @@ class LaravelContainerDecorator implements ContainerInterface
/**
* {@inheritdoc}
*/
- public function has($id)
+ public function has($id) : bool
{
if ($this->hasIsCached($id)) {
return $this->hasFromCache($id); | Added return type to LaravelContainerDecorator::has method to match interface definition | czim_file-handling | train | php |
280f16f017e3a5192dad8f470cb7f08d0445c197 | diff --git a/pact/pact-clients/src/main/java/eu/stratosphere/pact/client/nephele/api/PactProgram.java b/pact/pact-clients/src/main/java/eu/stratosphere/pact/client/nephele/api/PactProgram.java
index <HASH>..<HASH> 100644
--- a/pact/pact-clients/src/main/java/eu/stratosphere/pact/client/nephele/api/PactProgram.java
+++ b/pact/pact-clients/src/main/java/eu/stratosphere/pact/client/nephele/api/PactProgram.java
@@ -106,9 +106,9 @@ public class PactProgram {
*/
public PactProgram(File jarFile, String className, String... args)
throws ProgramInvocationException {
- this.assemblerClass = getPactAssemblerFromJar(jarFile, className);
this.jarFile = jarFile;
this.args = args;
+ this.assemblerClass = getPactAssemblerFromJar(jarFile, className);
}
/** | - fixed PactProgram constructor (bug reported by Thomas Bodner) | apache_flink | train | java |
4582f4397a137da19d5827a571c8804be0e10c37 | diff --git a/common/test/java/org/openqa/selenium/internal/PortProber.java b/common/test/java/org/openqa/selenium/internal/PortProber.java
index <HASH>..<HASH> 100644
--- a/common/test/java/org/openqa/selenium/internal/PortProber.java
+++ b/common/test/java/org/openqa/selenium/internal/PortProber.java
@@ -18,6 +18,7 @@ limitations under the License.
package org.openqa.selenium.internal;
import java.io.IOException;
+import java.lang.Math;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@@ -46,10 +47,10 @@ public class PortProber {
synchronized (random) {
int seed = random.nextInt();
// avoid protected ports
- while (seed < 1025 || seed > 65534) {
- seed = random.nextInt();
- }
-
+ final int FIRST_PORT = 1025;
+ final int LAST_PORT = 65534;
+ final int randomInt = Math.abs(random.nextInt());
+ seed = (randomInt % (LAST_PORT - FIRST_PORT + 1)) + FIRST_PORT;
return seed;
}
} | EranMes: Randomizing once should be enough.
r<I> | SeleniumHQ_selenium | train | java |
5546728695cd0ee0ad23acca653f73ccd6c680d8 | diff --git a/tests/Google/Task/ComposerTest.php b/tests/Google/Task/ComposerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Google/Task/ComposerTest.php
+++ b/tests/Google/Task/ComposerTest.php
@@ -149,7 +149,7 @@ class Google_Task_ComposerTest extends BaseTest
{
$composerJson = json_encode([
'require' => [
- 'google/apiclient' => 'dev-add-composer-cleanup'
+ 'google/apiclient' => 'dev-master'
],
'scripts' => [
'post-update-cmd' => 'Google_Task_Composer::cleanup'
@@ -178,7 +178,7 @@ class Google_Task_ComposerTest extends BaseTest
$composerJson = json_encode([
'require' => [
- 'google/apiclient' => 'dev-add-composer-cleanup'
+ 'google/apiclient' => 'dev-master'
],
'scripts' => [
'post-update-cmd' => 'Google_Task_Composer::cleanup' | test: composer cleanup task branch (#<I>) | googleapis_google-api-php-client | train | php |
4d98c684ef8d347177ce5bea8a1df4a8879ba15c | diff --git a/resources/lang/fi-FI/cachet.php b/resources/lang/fi-FI/cachet.php
index <HASH>..<HASH> 100644
--- a/resources/lang/fi-FI/cachet.php
+++ b/resources/lang/fi-FI/cachet.php
@@ -75,10 +75,11 @@ return [
// Subscriber
'subscriber' => [
- 'subscribe' => 'Tilaa uusimmat päivitykset',
- 'unsubscribe' => 'Unsubscribe at :link',
- 'button' => 'Tilaa',
- 'manage' => [
+ 'subscribe' => 'Tilaa uusimmat päivitykset',
+ 'unsubscribe' => 'Unsubscribe',
+ 'button' => 'Tilaa',
+ 'manage_subscription' => 'Manage subscription',
+ 'manage' => [
'no_subscriptions' => 'Olet tällä hetkellä tilannut kaikki ilmoitukset.',
'my_subscriptions' => 'Olet tällä hetkellä tilannut seuraavat ilmoitukset.',
'manage_at_link' => 'Manage your subscriptions at :link', | New translations cachet.php (Finnish) | CachetHQ_Cachet | train | php |
62e8d08bd97e564c5c2dabb1d5408a43a937d309 | diff --git a/src/body.js b/src/body.js
index <HASH>..<HASH> 100644
--- a/src/body.js
+++ b/src/body.js
@@ -117,8 +117,7 @@
};
planet.projection = d3.geo.orthographic()
- .clipAngle(90)
- .precision(0);
+ .clipAngle(90);
planet.path = d3.geo.path().projection(planet.projection);
return planet; | (core) Don't disable adaptive resampling on the projection | BinaryMuse_planetary.js | train | js |
9e90f0ef3604afaaad65a4e045aaccfd5023775f | diff --git a/src/main/java/com/cronutils/StringValidations.java b/src/main/java/com/cronutils/StringValidations.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/cronutils/StringValidations.java
+++ b/src/main/java/com/cronutils/StringValidations.java
@@ -12,8 +12,6 @@
*/
package com.cronutils;
-import static com.google.common.base.Preconditions.checkArgument;
-
import java.util.Iterator;
import java.util.Set;
import java.util.regex.Matcher;
@@ -69,7 +67,10 @@ public class StringValidations {
StringBuilder builder = new StringBuilder(ESCAPED_START);
Iterator<String> iterator = words.iterator();
- checkArgument(iterator.hasNext());
+ if (!iterator.hasNext()) {
+ builder.append(ESCAPED_END);
+ return Pattern.compile(builder.toString());
+ }
String next = iterator.next();
builder.append(next);
while (iterator.hasNext()) { | Minor test fix.
We should not throw an exception if there are no words. | jmrozanec_cron-utils | train | java |
abeef443ee4f62deb7417f337fe91705e4325aff | diff --git a/mousetrap.js b/mousetrap.js
index <HASH>..<HASH> 100644
--- a/mousetrap.js
+++ b/mousetrap.js
@@ -1014,6 +1014,8 @@
// expose mousetrap as an AMD module
if (typeof define === 'function' && define.amd) {
- define(Mousetrap);
+ define(function() {
+ return Mousetrap;
+ });
}
}) (window, document); | Update AMD define call so that it works with Mousetrap <I>
Fixes #<I>
Closes #<I>
Mousetrap is now a constructor function vs. a global object so I
**think** this is the way to make it work. If anyone with more
knowledge about AMD could confirm that would be great | ccampbell_mousetrap | train | js |
cef215fa6d260f2c59475b9ef467bf84c708003a | diff --git a/lib/raygun.messageBuilder.js b/lib/raygun.messageBuilder.js
index <HASH>..<HASH> 100644
--- a/lib/raygun.messageBuilder.js
+++ b/lib/raygun.messageBuilder.js
@@ -97,9 +97,9 @@ var RaygunMessageBuilder = function () {
this.setUser = function (user) {
if (user instanceof Function) {
- message.details.user = { 'identifier': user() };
+ message.details.user = { 'identifier': user() };
} else {
- message.details.user = { 'identifier': user };
+ message.details.user = { 'identifier': user };
}
return this;
}; | found some dastardly tabs hiding out amongst the spaces | MindscapeHQ_raygun4node | train | js |
e2f54360b7558bdb36b17576fb93fb08db6353d9 | diff --git a/lab_members/models.py b/lab_members/models.py
index <HASH>..<HASH> 100644
--- a/lab_members/models.py
+++ b/lab_members/models.py
@@ -213,7 +213,6 @@ class Records(models.Model):
class Meta:
abstract = True
- ordering = ['-year_start', '-year_end']
institution = models.ForeignKey('lab_members.Institution',
help_text=u'Please enter the institution attended',
@@ -241,6 +240,7 @@ class Records(models.Model):
class Education(Records):
class Meta:
+ ordering = ['-year_start', '-year_end']
verbose_name = "Education record"
verbose_name_plural = "Education records"
@@ -282,6 +282,7 @@ class Education(Records):
class Employment(Records):
class Meta:
+ ordering = ['-year_start', '-year_end']
verbose_name = "Employment record"
verbose_name_plural = "Employment records" | Fix ordering of Education/Employment Records | mfcovington_django-lab-members | train | py |
d07a3e09c97a615ce8ee28aa44c6b4f6a3d9f3a4 | diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index <HASH>..<HASH> 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -52,7 +52,7 @@ func (b *Bmattermost) Connect() error {
return nil
}
- if strings.HasPrefix(b.getVersion(), "6.") {
+ if strings.HasPrefix(b.getVersion(), "6.") || strings.HasPrefix(b.getVersion(), "7.") {
if !b.v6 {
b.v6 = true
} | Support mattermost v7 (#<I>)
Mattermost api (almost) didn't change between <I>.x and <I>
Everything should just work | 42wim_matterbridge | train | go |
76adf373c07e4a801e96f3389118ca9fa82cb656 | diff --git a/src/Command/report/report-acsf.tpl.php b/src/Command/report/report-acsf.tpl.php
index <HASH>..<HASH> 100644
--- a/src/Command/report/report-acsf.tpl.php
+++ b/src/Command/report/report-acsf.tpl.php
@@ -15,14 +15,17 @@
}
@media print {
.table .danger td,
+ .table td.danger,
.table .danger th {
background-color: #f2dede !important;
}
.table .warning td,
+ .table td.warning,
.table .warning th {
background-color: #fcf8e3 !important;
}
.table .success td,
+ .table td.success,
.table .success th {
background-color: #dff0d8 !important;
} | Allow colours on table cells to print. | drutiny_drutiny | train | php |
039dc85048309d16e66f2db7d810c3c2823cbafc | diff --git a/lib/pdf/info.rb b/lib/pdf/info.rb
index <HASH>..<HASH> 100644
--- a/lib/pdf/info.rb
+++ b/lib/pdf/info.rb
@@ -64,11 +64,11 @@ module PDF
when "Pages"
metadata[:page_count] = pair.last.to_i
when "Encrypted"
- metadata[:encrypted] = pair.last == 'yes'
+ metadata[:encrypted] = pair.last.start_with?('yes')
when "Optimized"
- metadata[:optimized] = pair.last == 'yes'
+ metadata[:optimized] = pair.last.start_with?('yes')
when "Tagged"
- metadata[:tagged] = pair.last == 'yes'
+ metadata[:tagged] = pair.last.start_with?('yes')
when "PDF version"
metadata[:version] = pair.last.to_f
when "CreationDate" | For PDFs including more information per key/value pair | newspaperclub_pdf_info | train | rb |
d57acaa2e62521490b69aa8df800d0e71b08b575 | diff --git a/qunit/qunit.js b/qunit/qunit.js
index <HASH>..<HASH> 100644
--- a/qunit/qunit.js
+++ b/qunit/qunit.js
@@ -296,7 +296,7 @@ var QUnit = {
start: function() {
// A slight delay, to avoid any current callbacks
- if ( window.setTimeout ) {
+ if ( typeof window.setTimeout !== "undefined" ) {
window.setTimeout(function() {
if ( config.timeout ) {
clearTimeout(config.timeout); | making window setTimeout query more consistent | JamesMGreene_qunit-assert-html | train | js |
56d179e350450fff672ad695baf080e340707206 | diff --git a/safe/impact_functions/generic/categorical_hazard_building.py b/safe/impact_functions/generic/categorical_hazard_building.py
index <HASH>..<HASH> 100644
--- a/safe/impact_functions/generic/categorical_hazard_building.py
+++ b/safe/impact_functions/generic/categorical_hazard_building.py
@@ -330,7 +330,7 @@ class CategoricalHazardBuildingImpactFunction(FunctionProvider):
# Create style
style_classes = [dict(label=tr('Not Affected'),
- value=0,
+ value=None,
colour='#1EFC7C',
transparency=0,
size=2, | fixed assigning other values not in parameters as not affected | inasafe_inasafe | train | py |
ca754ac3098ca29eef166e76f2750d232a34e8c4 | diff --git a/wp/Menu.php b/wp/Menu.php
index <HASH>..<HASH> 100755
--- a/wp/Menu.php
+++ b/wp/Menu.php
@@ -91,7 +91,7 @@ class Menu
if (array_key_exists($item->ID, $this->_items)) {
$item->classes[] = app()->menu['dropdown_class'];
$_item['items'] = $this->walk($this->_items[$item->ID]);
- unset($_item['url']);
+ // unset($_item['url']);
}
$_item['options'] = [
@@ -107,4 +107,4 @@ class Menu
return $_items;
}
-}
\ No newline at end of file
+} | Update Menu.php
Changed the behavior of method Menu::walk(). Now Url is not deleted when there are children. | nikonorovsv_wpf | train | php |
4333ea73cde16e9b0451f1df84f35711a700368b | diff --git a/test/src/packageJSONExists.test.js b/test/src/packageJSONExists.test.js
index <HASH>..<HASH> 100644
--- a/test/src/packageJSONExists.test.js
+++ b/test/src/packageJSONExists.test.js
@@ -1,6 +1,6 @@
require('chai').should();
const helpers = require('../../lib/helpers');
-const syncExec = require('sync-exec');
+const {execSync} = require('child_process');
describe('packageJSONExists', () => {
it('should return true', () => {
@@ -8,9 +8,9 @@ describe('packageJSONExists', () => {
});
it('should return false', () => {
- syncExec('mv package.json package.json.disappeared');
+ execSync('mv package.json package.json.disappeared');
helpers.packageJSONExists().should.equal(false);
- syncExec('mv package.json.disappeared package.json');
+ execSync('mv package.json.disappeared package.json');
});
}); | remove exec sync from test | siddharthkp_auto-install | train | js |
c8bc1b0d3cd2858d19bec3e37db5dee4306d8b56 | diff --git a/core/server/config/index.js b/core/server/config/index.js
index <HASH>..<HASH> 100644
--- a/core/server/config/index.js
+++ b/core/server/config/index.js
@@ -278,11 +278,11 @@ ConfigManager.prototype.set = function (config) {
},
db: {
extensions: ['.json', '.zip'],
- contentTypes: ['application/octet-stream', 'application/json', 'application/zip']
+ contentTypes: ['application/octet-stream', 'application/json', 'application/zip', 'application/x-zip-compressed']
},
themes: {
extensions: ['.zip'],
- contentTypes: ['application/zip']
+ contentTypes: ['application/zip', 'application/x-zip-compressed']
}
},
deprecatedItems: ['updateCheck', 'mail.fromaddress'], | allow windows flavor of zip mime type to be uploaded (#<I>)
refs #<I>
- add 'application/x-zip-compressed' to allowed mime types for import
and theme upload | TryGhost_Ghost | train | js |
4a9a6ed90dcadeca8abba58ea61c3b00c4f43f30 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -184,8 +184,9 @@ app.kill = function( signal, callback ) {
// send kill signal
if( app.child ) {
+ var pid = gutil.colors.magenta( app.child.pid );
+
var stopped = function() {
- var pid = gutil.colors.magenta( app.child.pid );
app.child = null;
done( null, 'Development server was stopped. (PID:' + pid + ')', callback );
}; | Fix case `child.pid` is null #<I>
app.child might be an empty object.
If so, I will add more patch. | narirou_gulp-develop-server | train | js |
96bbf57a941584ccb773ad3bfdbbcd02929a7c8c | diff --git a/scrapelib/__init__.py b/scrapelib/__init__.py
index <HASH>..<HASH> 100644
--- a/scrapelib/__init__.py
+++ b/scrapelib/__init__.py
@@ -266,8 +266,8 @@ class RetrySession(requests.Session):
# compose sessions, order matters
class Scraper(RobotsTxtSession, # first, check robots.txt
- ThrottledSession, # throttle requests
CachingSession, # cache responses
+ ThrottledSession, # throttle requests
RetrySession, # do retries
):
""" | switch order of Caching/Throttled sessions | jamesturk_scrapelib | train | py |
60694223005ed470bd6b9e73f69ab717bba4b885 | diff --git a/lib/opulent/version.rb b/lib/opulent/version.rb
index <HASH>..<HASH> 100644
--- a/lib/opulent/version.rb
+++ b/lib/opulent/version.rb
@@ -1,4 +1,4 @@
# @Opulent
module Opulent
- VERSION = '1.8.4'
+ VERSION = '1.8.5'
end | Added support for rscss -modifier classes. | opulent_opulent | train | rb |
b4b39e9c40db933796284091d019be0de6e8f7c8 | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -300,7 +300,7 @@ var CodeMirror = (function() {
// (and later restore it again), shouldn't be used for
// non-movement keys.
curKeyId = (mod ? "c" : "") + code;
- if (sel.inverted && movementKeys.hasOwnProperty(id)) {
+ if (sel.inverted && movementKeys.hasOwnProperty(curKeyId)) {
var range = selRange(input);
if (range) {
reducedSelection = {anchor: range.start}; | fix broken reverted-selection
i forgot to rename a use of a variable when i renamed its def | codemirror_CodeMirror | train | js |
b54f1487ee655680157650a2262156ad07d7a14c | diff --git a/controllers/controllerhelpers/chatScrollback.go b/controllers/controllerhelpers/chatScrollback.go
index <HASH>..<HASH> 100644
--- a/controllers/controllerhelpers/chatScrollback.go
+++ b/controllers/controllerhelpers/chatScrollback.go
@@ -15,7 +15,5 @@ func BroadcastScrollback(so *wsevent.Client, room uint) {
return
}
- for i := len(messages) - 1; i != -1; i-- {
- so.EmitJSON(helpers.NewRequest("chatReceive", messages[i]))
- }
+ so.EmitJSON(helpers.NewRequest("chatScrollback", messages))
} | Send chat scrollback as a single message | TF2Stadium_Helen | train | go |
148f69768671aa883567fd673594af516b00706f | diff --git a/staff/admin.py b/staff/admin.py
index <HASH>..<HASH> 100644
--- a/staff/admin.py
+++ b/staff/admin.py
@@ -17,8 +17,8 @@ class StaffMemberAdmin(admin.StackedInline):
"""
# form = StaffMemberForm
fieldsets = (
- ('Personal Info', {'fields': ('bio', 'photo', 'twitter', 'website',
- 'phone',)}),
+ ('Personal Info', {'fields': ('bio', 'photo', 'website', 'phone',)}),
+ ('Social Media', {'fields': ('twitter', 'facebook', 'google_plus')}),
('Responsibilities', {'fields': ('sites',)}),
)
filter_horizontal = ('sites',) | Rearranged the staff admin for the social media fields | callowayproject_django-staff | train | py |
035fea7e6e24768447cf1c4f45f02cf831440491 | diff --git a/monitor/services/src/main/java/org/eobjects/datacleaner/monitor/server/job/DataCleanerJobEngine.java b/monitor/services/src/main/java/org/eobjects/datacleaner/monitor/server/job/DataCleanerJobEngine.java
index <HASH>..<HASH> 100644
--- a/monitor/services/src/main/java/org/eobjects/datacleaner/monitor/server/job/DataCleanerJobEngine.java
+++ b/monitor/services/src/main/java/org/eobjects/datacleaner/monitor/server/job/DataCleanerJobEngine.java
@@ -99,6 +99,20 @@ public class DataCleanerJobEngine extends AbstractJobEngine<DataCleanerJobContex
_runningJobs = new ConcurrentHashMap<String, AnalysisResultFuture>();
}
+ /**
+ *
+ * @param clusterManagerFactory
+ * @param descriptorProvider
+ *
+ * @deprecated use
+ * {@link #DataCleanerJobEngine(ClusterManagerFactory, DescriptorProvider, ApplicationContext)}
+ * instead
+ */
+ @Deprecated
+ public DataCleanerJobEngine(ClusterManagerFactory clusterManagerFactory, DescriptorProvider descriptorProvider) {
+ this(clusterManagerFactory, descriptorProvider, null);
+ }
+
@Override
public String getJobType() {
return "DataCleanerAnalysisJob"; | Added backwards compatible (but deprecated) constructor for DCJobEngine | datacleaner_DataCleaner | train | java |
842abd419310f41ec854c3a3d38fed3d85fdf50a | diff --git a/test/word_embedding_loader/conftest.py b/test/word_embedding_loader/conftest.py
index <HASH>..<HASH> 100644
--- a/test/word_embedding_loader/conftest.py
+++ b/test/word_embedding_loader/conftest.py
@@ -28,7 +28,7 @@ def word2vec_bin_file():
@pytest.fixture
def word2vec_text_file(tmpdir):
- with open(tmpdir.join('glove.txt').strpath, 'a+') as f:
+ with open(tmpdir.join('word2vec_text_file.txt').strpath, 'a+') as f:
f.write(u"""3 2
</s> 0.080054 0.088388
the -1.420859 1.156857
@@ -40,7 +40,7 @@ the -1.420859 1.156857
@pytest.fixture
def vocab_file(tmpdir):
- with open(tmpdir.join('glove.txt').strpath, 'a+') as f:
+ with open(tmpdir.join('vocab_file.txt').strpath, 'a+') as f:
f.write(u"""</s> 0
日本語 593677""".encode('utf-8'))
f.flush() | bugfix: pytest.fixture tmpdir was causing name collision | koreyou_word_embedding_loader | train | py |
f516751281c218c4899d718b84d9c591b7326564 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -21,20 +21,20 @@ test('middleware configuration need a store', t => {
t.end()
})
-test('middleware need a store with a valid API', t => {
+test.skip('middleware need a store with a valid API', t => {
const handler = superapiCache({
store: {}
})
- const next = () => {
- return Promise.resolve()
- }
+ return new Promise((resolve, reject) => {
+ t.throws(() => {
+ handler({}, function () {}, {})
- t.throws(() => {
- handler({}, next, {})
- }, /store.getItem/, 'should throw if invalid store provided')
-
- t.end()
+ resolve()
+ }, /Error/, 'should throw if invalid store provided')
+ }).catch(err => {
+ console.log(err);
+ })
})
test('cache read function', t => { | test(store): deactivate failing test
Too bad but minor impact. | RasCarlito_axios-cache-adapter | train | js |
0d5ed014d193d03f841de32e282311ddd61a78f5 | diff --git a/cake/console/shell_dispatcher.php b/cake/console/shell_dispatcher.php
index <HASH>..<HASH> 100644
--- a/cake/console/shell_dispatcher.php
+++ b/cake/console/shell_dispatcher.php
@@ -80,8 +80,6 @@ class ShellDispatcher {
*/
function __initConstants() {
if (function_exists('ini_set')) {
- ini_set('display_errors', '1');
- ini_set('error_reporting', E_ALL & ~E_DEPRECATED);
ini_set('html_errors', false);
ini_set('implicit_flush', true);
ini_set('max_execution_time', 0);
@@ -90,7 +88,6 @@ class ShellDispatcher {
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('DS', DIRECTORY_SEPARATOR);
define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(dirname(__FILE__))));
- define('DISABLE_DEFAULT_ERROR_HANDLING', false);
define('CAKEPHP_SHELL', true);
if (!defined('CORE_PATH')) {
if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ini_get('include_path'))) { | Removing constants and configuration settings that don't are repeated or deprecated/not used. | cakephp_cakephp | train | php |
2501bc052f28ccdf9eba4774138a3056c20c539d | diff --git a/gwpy/io/nds.py b/gwpy/io/nds.py
index <HASH>..<HASH> 100644
--- a/gwpy/io/nds.py
+++ b/gwpy/io/nds.py
@@ -58,8 +58,10 @@ for ctype in (nds2.channel.CHANNEL_TYPE_RAW,
nds2.channel.CHANNEL_TYPE_STATIC,
nds2.channel.CHANNEL_TYPE_TEST_POINT):
NDS2_CHANNEL_TYPESTR[ctype] = nds2.channel_channel_type_to_string(ctype)
+NDS2_CHANNEL_TYPESTR[max(NDS2_CHANNEL_TYPESTR.keys()) * 2] = 'rds'
NDS2_CHANNEL_TYPE = dict((val, key) for (key, val) in
NDS2_CHANNEL_TYPESTR.iteritems())
+# manually add RDS
class NDSOutputContext(object): | io.nds: added 'rds' typestr | gwpy_gwpy | train | py |
e57dc184a53662e6092c1ac1d47b85e42ad1781e | diff --git a/src/icheck.js b/src/icheck.js
index <HASH>..<HASH> 100644
--- a/src/icheck.js
+++ b/src/icheck.js
@@ -23,6 +23,9 @@ function init(Survey, $) {
afterRender: function(question, el) {
var rootWidget = this;
var $el = $(el);
+
+ $el.find(".sv-radio__svg").hide();
+
$el.find("input").data({
iCheck: undefined
}); | fixed iCheck widget for bem theme | surveyjs_widgets | train | js |
7c7fcc1506a9456289d09f7eddca07fcb9063702 | diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py
index <HASH>..<HASH> 100644
--- a/custodian/vasp/handlers.py
+++ b/custodian/vasp/handlers.py
@@ -956,6 +956,9 @@ class FrozenJobErrorHandler(ErrorHandler):
if vi["INCAR"].get("ALGO", "Normal") == "Fast":
actions.append({"dict": "INCAR",
"action": {"_set": {"ALGO": "Normal"}}})
+ elif vi["INCAR"].get("ALGO", "Normal") == "Normal":
+ actions.append({"dict": "INCAR",
+ "action": {"_set": {"SYMPREC": 1e-8}}})
VaspModder(vi=vi).apply_actions(actions) | Changed FrozenJobErrorHandler, will change SYMPREC=1E-8 if changing ALGO=Normal doesnt work | materialsproject_custodian | train | py |
257baf137fdb590042c23bf98059ea2191f935a4 | diff --git a/tests/library/CM/Mail/WelcomeTest.php b/tests/library/CM/Mail/WelcomeTest.php
index <HASH>..<HASH> 100644
--- a/tests/library/CM/Mail/WelcomeTest.php
+++ b/tests/library/CM/Mail/WelcomeTest.php
@@ -8,8 +8,8 @@ class CM_Mail_WelcomeTest extends CMTest_TestCase {
$language = CM_Model_Language::create('Test language', 'foo', true);
$language->setTranslation('Welcome to {$siteName}!', 'foo');
- $mailRendered = $mail->render();
- $nodeList = new CM_Dom_NodeList(htmlspecialchars($mailRendered[1]));
+ list($subject, $html, $text) = $mail->render();
+ $nodeList = new CM_Dom_NodeList(htmlspecialchars($html));
$this->assertContains('foo', $nodeList->getText());
} | use "list" to assign vars | cargomedia_cm | train | php |
3f2bd2305b75d53dbea3cf497495668d3adab00c | diff --git a/lib/virtualbox/version.rb b/lib/virtualbox/version.rb
index <HASH>..<HASH> 100644
--- a/lib/virtualbox/version.rb
+++ b/lib/virtualbox/version.rb
@@ -1,5 +1,5 @@
module VirtualBox
- VERSION = "0.8.1.dev"
+ VERSION = "0.8.1"
module Version
# Returns a boolean denoting whether the current VirtualBox | <I> - Fix a single major VirtualBox 4 compatibility bug | mitchellh_virtualbox | train | rb |
75a49fce36c00c92361d23a077d20ed267db6a3d | diff --git a/lib/Sabre/DAV/Browser/Plugin.php b/lib/Sabre/DAV/Browser/Plugin.php
index <HASH>..<HASH> 100644
--- a/lib/Sabre/DAV/Browser/Plugin.php
+++ b/lib/Sabre/DAV/Browser/Plugin.php
@@ -101,7 +101,7 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
if (isset($_POST['name']) && trim($_POST['name'])) {
// Using basename() because we won't allow slashes
$folderName = trim(basename($_POST['name']));
- $this->server->createDirectory($folderName);
+ $this->server->createDirectory($this->server->getRequestUri() . '/' . $folderName);
}
break;
case 'put' : | Fixed directory creation (only made dirs in root dir) | sabre-io_dav | train | php |
495da79ace580c3c776ee1e28697b8be15caca56 | diff --git a/lib/workerholic/starter.rb b/lib/workerholic/starter.rb
index <HASH>..<HASH> 100644
--- a/lib/workerholic/starter.rb
+++ b/lib/workerholic/starter.rb
@@ -13,6 +13,7 @@ module Workerholic
def self.kill_memory_tracker_thread
@thread.kill
+ StatsStorage.delete_memory_stats
end
private
@@ -68,8 +69,6 @@ module Workerholic
end
def self.track_memory_usage
- cleanup_old_memory_stats
-
@thread = Thread.new do
loop do
sleep 5
@@ -78,10 +77,6 @@ module Workerholic
end
end
- def self.cleanup_old_memory_stats
- StatsStorage.delete_memory_stats
- end
-
def self.launch
if options[:processes] && options[:processes] > 1
begin | cleanup memory stats when sutting down | workerholic_workerholic | train | rb |
c5154548c5ca1b811336ecae370e0e5d39cbf273 | diff --git a/test/local.js b/test/local.js
index <HASH>..<HASH> 100644
--- a/test/local.js
+++ b/test/local.js
@@ -210,6 +210,17 @@ describe('Local', function () {
});
});
+ it('should stop local', function (done) {
+ this.timeout(MAX_TIMEOUT);
+ bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY}, function(){
+ expect(bsLocal.isRunning()).to.equal(true);
+ bsLocal.stop(function(){
+ expect(bsLocal.isRunning()).to.equal(false);
+ done();
+ });
+ });
+ });
+
afterEach(function (done) {
this.timeout(60000);
bsLocal.stop(done); | Adding test for checking whether local stop is working or not | browserstack_browserstack-local-nodejs | train | js |
b9d6c9b95efc256df9ae80516463285281a55487 | diff --git a/asammdf/mdf_v4.py b/asammdf/mdf_v4.py
index <HASH>..<HASH> 100644
--- a/asammdf/mdf_v4.py
+++ b/asammdf/mdf_v4.py
@@ -1449,8 +1449,6 @@ class MDF4(object):
if sig.samples.dtype.kind in 'ui'
]
-
-
max_itemsize = 1
dtype_ = dtype(uint8)
@@ -1626,6 +1624,7 @@ class MDF4(object):
else:
address = tell()
conv_texts_tab['text_{}'.format(i)] = address
+ write(bytes(block))
if 'default' in info:
block = TextBlock(
text=info['default'],
diff --git a/asammdf/v4_blocks.py b/asammdf/v4_blocks.py
index <HASH>..<HASH> 100644
--- a/asammdf/v4_blocks.py
+++ b/asammdf/v4_blocks.py
@@ -1913,8 +1913,8 @@ class TextBlock(dict):
self['text'] = text = stream.read(size)
if self['id'] not in (b'##TX', b'##MD'):
- message = 'Expected "##TX" or "##MD" block but found "{}"'
- raise MdfException(message.format(self['id']))
+ message = 'Expected "##TX" or "##MD" block @{} but found "{}"'
+ raise MdfException(message.format(hex(address), self['id']))
else: | fix error in appending range to text conversion | danielhrisca_asammdf | train | py,py |
ded4c2a688b1d50eac084f6575df814b710e9906 | diff --git a/SpiffWorkflow/task.py b/SpiffWorkflow/task.py
index <HASH>..<HASH> 100644
--- a/SpiffWorkflow/task.py
+++ b/SpiffWorkflow/task.py
@@ -268,18 +268,19 @@ class Task(object):
The task will loop, repeatedly asking for input until terminate_loop
is called on the task
"""
-
- def raiseError():
+ if self.is_looping():
+ self.terminate_current_loop = True
+ else:
raise WorkflowException(self.task_spec,
'The method terminate_loop should only be called in the case of a BPMN Loop Task')
+ def is_looping(self):
+ """Returns true if this is a looping task."""
islooping = getattr(self.task_spec, "is_loop_task", None)
if callable(islooping):
- if not (self.task_spec.is_loop_task()):
- raiseError()
+ return self.task_spec.is_loop_task()
else:
- raiseError()
- self.terminate_current_loop = True
+ return False
def set_children_future(self):
""" | provide a way to tell if a running task will loop. | knipknap_SpiffWorkflow | train | py |
db75464c1ce27ec15990feb5b9a408478f4d1209 | diff --git a/addok/batch.py b/addok/batch.py
index <HASH>..<HASH> 100644
--- a/addok/batch.py
+++ b/addok/batch.py
@@ -72,7 +72,7 @@ def batch(iterable):
continue
chunk.append(item)
count += 1
- if count % 10000 == 0:
+ if count % 20000 == 0:
for r in executor.map(process, chunk):
bar()
chunk = [] | Increase batch chunk from <I> to <I>
Import get 4% faster | addok_addok | train | py |
2ccdd102c49b9bf98f40ebda99dd19ab3009d86c | diff --git a/microframework/src/main/java/org/kevoree/modeling/memory/space/impl/press/FixedHeapFIFO.java b/microframework/src/main/java/org/kevoree/modeling/memory/space/impl/press/FixedHeapFIFO.java
index <HASH>..<HASH> 100644
--- a/microframework/src/main/java/org/kevoree/modeling/memory/space/impl/press/FixedHeapFIFO.java
+++ b/microframework/src/main/java/org/kevoree/modeling/memory/space/impl/press/FixedHeapFIFO.java
@@ -40,7 +40,7 @@ public class FixedHeapFIFO implements PressFIFO {
do {
currentTail = this._tail.get();
} while (!this._tail.compareAndSet(currentTail, index));
- this._next[currentTail] = index;
+ //this._next[currentTail] = index;
}
} | a small "optimization" | datathings_greycat | train | java |
0d0fa16ed55644a65a1e0c68ce3f2a684802d48d | diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/hosts/remotes.py
+++ b/ceph_deploy/hosts/remotes.py
@@ -36,10 +36,12 @@ def platform_information(_linux_distribution=None):
codename = minor
else:
codename = major
- if not codename and 'oracle' in distro.lower(): # this could be an empty string in Oracle linux
+ if not codename and 'oracle' in distro.lower(): # this could be an empty string in Oracle linux
codename = 'oracle'
- if not codename and 'virtuozzo linux' in distro.lower(): # this could be an empty string in Virtuozzo linux
+ if not codename and 'virtuozzo linux' in distro.lower(): # this could be an empty string in Virtuozzo linux
codename = 'virtuozzo'
+ if not codename and 'arch' in distro.lower(): # this could be an empty string in Arch linux
+ codename = 'arch'
return (
str(distro).rstrip(), | [RM-<I>] Fix distro detection for Arch Linux | ceph_ceph-deploy | train | py |
469e7ca22c304a42501b454143a65394be53537a | diff --git a/src/connection.js b/src/connection.js
index <HASH>..<HASH> 100644
--- a/src/connection.js
+++ b/src/connection.js
@@ -199,7 +199,7 @@ export default () => {
return this
}
- if (_.isObject(params))
+ if (_.isObject(params) && !_.isFunction(params))
{
_.assign(this.connection, _.pick(params, ['name', 'description', 'ename']))
callback = _.get(args, '[1]')
diff --git a/src/pipe.js b/src/pipe.js
index <HASH>..<HASH> 100644
--- a/src/pipe.js
+++ b/src/pipe.js
@@ -89,7 +89,7 @@ export default () => {
return this
}
- if (_.isObject(params))
+ if (_.isObject(params) && !_.isFunction(params))
{
_.assign(this.pipe, _.pick(params, ['name', 'description', 'ename']))
callback = _.get(args, '[1]') | For connection().save() and pipe().save(), check to make sure first param is explicitly not a function. | flexiodata_flexio-sdk-js | train | js,js |
50f2016b828ae816c29ed7bbb2e01ace0b2b97b0 | diff --git a/xmantissa/static/js/tdb.js b/xmantissa/static/js/tdb.js
index <HASH>..<HASH> 100644
--- a/xmantissa/static/js/tdb.js
+++ b/xmantissa/static/js/tdb.js
@@ -49,7 +49,12 @@ Mantissa.TDB.Controller.methods(
function _differentPage(self /*, ...*/) {
self._toggleThrobberVisibility();
- var d = self.callRemote.apply(self, arguments);
+ var args = [];
+ for (var i = 1; i < arguments.length; ++i) {
+ args.push(arguments[i]);
+ }
+
+ var d = self.callRemote.apply(self, args);
d.addCallback(function(result) {
var tdbTable = result[0];
var tdbState = result[1]; | Correct argument-forwarding thingy - `self" should not be passed to callRemote | twisted_mantissa | train | js |
3875a3335c8c6bf0f9c78d45b940ab010021f6d9 | diff --git a/app/controllers/discovered_hosts_controller.rb b/app/controllers/discovered_hosts_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/discovered_hosts_controller.rb
+++ b/app/controllers/discovered_hosts_controller.rb
@@ -247,7 +247,7 @@ class DiscoveredHostsController < ::ApplicationController
def find_multiple
# Lets search by name or id and make sure one of them exists first
if params[:host_names].present? or params[:host_ids].present?
- @hosts = Host::Discovered.where("id IN (?) or name IN (?)", params[:host_ids], params[:host_names] )
+ @hosts = Host::Discovered.includes(:model, :fact_values, :interfaces, :location, :organization).where("id IN (?) or name IN (?)", params[:host_ids], params[:host_names] )
if @hosts.empty?
error _('No hosts were found with that id or name')
redirect_to(discovered_hosts_path) and return false | Fixes #<I> - fixed N<I> queries in multiple delete | theforeman_foreman_discovery | train | rb |
41a3f2b1875f5b052f6af2241e91c413c9fae0df | diff --git a/lib/faraday/request/hmac.rb b/lib/faraday/request/hmac.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday/request/hmac.rb
+++ b/lib/faraday/request/hmac.rb
@@ -16,7 +16,7 @@ module Faraday
#
# @option options [String] :auth_scheme ('HMAC') The name of the authorization scheme used in the Authorization header and to construct various header-names
# @option options [String] :auth_param ('auth') The name of the authentication param to use for query based authentication
- # @option options [Hash] :extra_auth_params ({}) Additional parameters to inject in the auth parameter
+ # @option options [Hash] :extra_auth_params ({}) Additional parameters to inject in the auth parameter. This parameter is ignored unless :query_based evaluates to true.
# @option options [String] :auth_header ('Authorization') The name of the authorization header to use
# @option options [String] :auth_header_format ('%{auth_scheme} %{signature}') The format of the authorization header. Will be interpolated with the given options and the signature.
# @option options [String] :nonce_header ('X-#{auth_scheme}-Nonce') The header name for the request nonce | Updated API doc
Clarify that the extra_auth_params key will be ignored for header-based
auth. | Asquera_warden-hmac-authentication | train | rb |
14949353b98bf2742f87ad43c12c0ad0e414b4fc | diff --git a/test/lib/rules/new-line-for-blocks/test.spec.js b/test/lib/rules/new-line-for-blocks/test.spec.js
index <HASH>..<HASH> 100644
--- a/test/lib/rules/new-line-for-blocks/test.spec.js
+++ b/test/lib/rules/new-line-for-blocks/test.spec.js
@@ -13,12 +13,17 @@ describe('hint rule ' + rule, function () {
var result = htmlcs.hintFile(path.join(__dirname, 'case.html'));
it('should return right result', function () {
- expect(result.length).toBe(2);
+ expect(result.length).toBe(3);
expect(result[0].type).toBe('WARN');
expect(result[0].code).toBe('028');
expect(result[0].line).toBe(17);
expect(result[0].column).toBe(24);
+
+ expect(result[0].type).toBe('WARN');
+ expect(result[0].code).toBe('028');
+ expect(result[0].line).toBe(17);
+ expect(result[0].column).toBe(24);
expect(result[1].type).toBe('WARN');
expect(result[1].code).toBe('028'); | Fixing: New rule - Use a new line for every block, list, or table element, and indent every such child element. #<I> | ecomfe_htmlcs | train | js |
0075f11bd39aaf7bed3e22d8ea5e810af5b062b7 | diff --git a/btcpy/lib/parsing.py b/btcpy/lib/parsing.py
index <HASH>..<HASH> 100644
--- a/btcpy/lib/parsing.py
+++ b/btcpy/lib/parsing.py
@@ -190,7 +190,7 @@ class TransactionParser(Parser):
for _ in range(self.txins):
witnesses.append([StackData.from_bytes(self >> self.parse_varint()) for _ in range(self.parse_varint())])
return witnesses
- raise ValueError('Trying to get witness on a non-segwit transaction'y)
+ raise ValueError('Trying to get witness on a non-segwit transaction')
def __locktime(self):
from ..structs.transaction import Locktime | Sorry that 'y' snuck in there. | chainside_btcpy | train | py |
0cc15d96a046d18ea3bf0155d3fc6e4899910d28 | diff --git a/test/linear_ring_tests.rb b/test/linear_ring_tests.rb
index <HASH>..<HASH> 100644
--- a/test/linear_ring_tests.rb
+++ b/test/linear_ring_tests.rb
@@ -6,11 +6,16 @@ require 'test_helper'
class LinearRingTests < MiniTest::Unit::TestCase
include TestHelper
+ def setup
+ super
+ writer.trim = true
+ end
+
def test_to_polygon
geom = read('POLYGON ((0 0, 5 0, 5 5, 0 5, 0 0))')
ring = geom.exterior_ring
- assert_equal(write(geom), write(ring.to_polygon))
+ assert_equal('POLYGON ((0 0, 5 0, 5 5, 0 5, 0 0))', write(ring.to_polygon))
end
def test_to_polygon_with_srid | Hard-code the expected results for Geos::LinearRing tests. | dark-panda_ffi-geos | train | rb |
15668fce63ed2a16aefba5ad54571429751e9413 | diff --git a/client/layout/guided-tours/positioning.js b/client/layout/guided-tours/positioning.js
index <HASH>..<HASH> 100644
--- a/client/layout/guided-tours/positioning.js
+++ b/client/layout/guided-tours/positioning.js
@@ -87,7 +87,7 @@ export function targetForSlug( targetSlug ) {
if ( ! targetSlug ) {
return null;
}
- if ( targetSlug.indexOf( '.' ) !== -1 || targetSlug.indexOf( ' ' ) !== -1 ) {
+ if ( targetSlug.indexOf( '.' ) !== -1 || targetSlug.indexOf( '#' ) !== -1 || targetSlug.indexOf( ' ' ) !== -1 ) {
// a sort of hacky way to discern tip targets and regular css for now
// (e.g. misses #ids, ...)
// TODO(lsinger): fix this | Guided Tours: make `targetForSlug` work with ID-only selectors | Automattic_wp-calypso | train | js |
ff96f09f3a590b65285c4cb5a77756388c02425d | diff --git a/fut/core.py b/fut/core.py
index <HASH>..<HASH> 100644
--- a/fut/core.py
+++ b/fut/core.py
@@ -372,7 +372,7 @@ class Core(object):
raise ExpiredSession
elif rc.get('string') == 'Internal Server Error (ut)':
raise InternalServerError
- elif rc.get('string') == 'Permission Denied':
+ elif rc.get('code') == '461' or rc.get('string') == 'Permission Denied':
raise PermissionDenied
elif rc.get('string') == 'Captcha Triggered':
# img = self.r.get(self.urls['fut_captcha_img'], params={'_': int(time()*1000), 'token': captcha_token}).content # doesnt work - check headers | core: better catch [<I>] Permission Denied | futapi_fut | train | py |
deb1cb316e2532d393f5d754439bc71393cff4cc | diff --git a/athumb/backends/s3boto.py b/athumb/backends/s3boto.py
index <HASH>..<HASH> 100644
--- a/athumb/backends/s3boto.py
+++ b/athumb/backends/s3boto.py
@@ -195,7 +195,7 @@ class S3BotoStorage_AllPublic(S3BotoStorage):
just simply dump out a URL rather than having to query S3 for new keys.
"""
name = self._clean_name(name)
- return "http://%s.s3.amazonaws.com/%s" % (self.bucket_name, name)
+ return "http://s3.amazonaws.com/%s/%s" % (self.bucket_name, name)
class S3BotoStorageFile(File):
def __init__(self, name, mode, storage): | Changing the AllPublic URL to consistently use s3.amazonaws.com, with the bucket appended. This will reduce DNS lookups. | gtaylor_django-athumb | train | py |
d7440f882dd6caea78b153bcb3b53e460ae1d830 | diff --git a/src/extensions/scratch3_wedo2/index.js b/src/extensions/scratch3_wedo2/index.js
index <HASH>..<HASH> 100644
--- a/src/extensions/scratch3_wedo2/index.js
+++ b/src/extensions/scratch3_wedo2/index.js
@@ -226,7 +226,15 @@ class WeDo2Motor {
* @param {int} value - this motor's new power level, in the range [0,100].
*/
set power (value) {
- this._power = Math.max(0, Math.min(value, 100));
+ const p = Math.max(0, Math.min(value, 100));
+ // Lego Wedo 2.0 hub only turns motors at power range [30 - 100], so
+ // map value from [0 - 100] to [30 - 100].
+ if (p === 0) {
+ this._power = 0;
+ } else {
+ const delta = 100 / p;
+ this._power = 30 + (70 / delta);
+ }
}
/**
@@ -305,7 +313,7 @@ class WeDo2Motor {
*/
turnOff (useLimiter = true) {
if (this._power === 0) return;
-
+
const cmd = this._parent.generateOutputCommand(
this._index + 1,
WeDo2Command.MOTOR_POWER, | Fixing #<I>: WeDo2 motor power between 0-<I>ish doesn't power the motor. | LLK_scratch-vm | train | js |
520a12d7d87132a67dc024def68f3cf9327db3ff | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -56,8 +56,8 @@ setup(
],
tests_require=['flake8', 'scikit-image'],
extras_require={
- 'all': ['pillow', 'scipy', 'h5py', 'lmdb>=0.92', 'matplotlib', 'scikit-learn'] +
- ['python-prctl'] if platform.system() == 'Linux' else [],
+ 'all': ['pillow', 'scipy', 'h5py', 'lmdb>=0.92', 'matplotlib', 'scikit-learn'],
+ 'all: "Linux" in sys_platform': ['python-prctl'],
'all: python_version < "3.0"': ['tornado'],
},
) | Prevent install python-prctl outside Linux when installing by wheel (#<I>). (#<I>)
When tensorpack was installed by wheel the platform was already evaluated
and thus python-prctl was installed, even though it is Linux-specific.
Installing from source package or sources was OK.
Instead use a platform specifier that is evaluated while installing the wheel. | tensorpack_tensorpack | train | py |
25bf64bd1fbd9b03ff609d8b8614ce40b7a4f4be | diff --git a/packages/yup/tests/date.test.js b/packages/yup/tests/date.test.js
index <HASH>..<HASH> 100644
--- a/packages/yup/tests/date.test.js
+++ b/packages/yup/tests/date.test.js
@@ -4,7 +4,10 @@ const INVALID = 'Date is invalid.';
const defaults = {};
-const validate = async (date, { format, min, max, message } = defaults) => {
+const validate = async (
+ date,
+ { format, min, max, message, inclusivity } = defaults
+) => {
let schema = avDate({
format,
});
@@ -18,7 +21,9 @@ const validate = async (date, { format, min, max, message } = defaults) => {
}
if (min && max) {
- schema = schema.between(min, max, message);
+ schema = inclusivity
+ ? schema.between(min, max, message, inclusivity)
+ : schema.between(min, max, message);
}
return schema.validate(date);
@@ -145,5 +150,14 @@ describe('Date', () => {
format: 'YYYY/MM/DD',
})
).rejects.toThrow();
+
+ await expect(
+ validate('2012/12/12', {
+ max: '2012/12/12',
+ min: '2012/12/10',
+ format: 'YYYY/MM/DD',
+ inclusivity: '(]',
+ })
+ ).resolves.toBeTruthy();
});
}); | feat(yup): unit test for inclusivity | Availity_sdk-js | train | js |
c2f904b1cf646aa38c59c96986cf28f540f982f5 | diff --git a/biz/index.js b/biz/index.js
index <HASH>..<HASH> 100644
--- a/biz/index.js
+++ b/biz/index.js
@@ -76,6 +76,7 @@ module.exports = function(req, res, next) {
}
var colon = proxyUrl.indexOf(':');
var proxyPort = colon === -1 ? 80 : proxyUrl.substring(colon + 1);
+ req.headers.host = 'local.whistlejs.com';
util.transformReq(req, res, proxyPort > 0 ? proxyPort : 80, ip);
});
} else if (isWebUI) { | refactor: webui path | avwo_whistle | train | js |
057b8c64c018bf0ae2d6984283aef6606cb426dd | diff --git a/spacy/cli/project/assets.py b/spacy/cli/project/assets.py
index <HASH>..<HASH> 100644
--- a/spacy/cli/project/assets.py
+++ b/spacy/cli/project/assets.py
@@ -1,6 +1,7 @@
from typing import Any, Dict, Optional
from pathlib import Path
from wasabi import msg
+import os
import re
import shutil
import requests
@@ -129,10 +130,17 @@ def fetch_asset(
the asset failed.
"""
dest_path = (project_path / dest).resolve()
- if dest_path.exists() and checksum:
+ if dest_path.exists():
# If there's already a file, check for checksum
- if checksum == get_checksum(dest_path):
- msg.good(f"Skipping download with matching checksum: {dest}")
+ if checksum:
+ if checksum == get_checksum(dest_path):
+ msg.good(f"Skipping download with matching checksum: {dest}")
+ return
+ else:
+ # If there's not a checksum, make sure the file is a possibly valid size
+ if os.path.getsize(dest_path) == 0:
+ msg.warn(f"Asset exists but with size of 0 bytes, deleting: {dest}")
+ os.remove(dest_path)
# We might as well support the user here and create parent directories in
# case the asset dir isn't listed as a dir to create in the project.yml
if not dest_path.parent.exists(): | Check for assets with size of 0 bytes (#<I>)
* Check for assets with size of 0 bytes
* Update spacy/cli/project/assets.py | explosion_spaCy | train | py |
c685b9b0d0da246cbfb697bb32e02ee953fa762d | diff --git a/packages/next-server/lib/router/router.js b/packages/next-server/lib/router/router.js
index <HASH>..<HASH> 100644
--- a/packages/next-server/lib/router/router.js
+++ b/packages/next-server/lib/router/router.js
@@ -1,4 +1,4 @@
-/* global __NEXT_DATA__ */
+/* global __NEXT_DATA__, location */
import { parse } from 'url'
import mitt from '../mitt'
@@ -40,6 +40,16 @@ export default class Router {
this.changeState('replaceState', formatWithValidation({ pathname, query }), as)
window.addEventListener('popstate', this.onPopState)
+
+ // Workaround for weird Firefox bug, see below links
+ // https://github.com/zeit/next.js/issues/3817
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1422334
+ // TODO: let's remove this once the Firefox bug is resolved
+ if (navigator.userAgent && navigator.userAgent.match(/firefox/i)) {
+ window.addEventListener('unload', () => {
+ if (location.search) location.replace(location)
+ })
+ }
}
} | Apply workaround for Firefox bug (#<I>)
* Apply workaround for Firefox bug
and shallow routing
* Update to only apply workaround when needed
* Add TODO for future removal | zeit_next.js | train | js |
2c325d532ca7cd3ecd3a39a32df500001ad5ef18 | diff --git a/zstandard/cffi.py b/zstandard/cffi.py
index <HASH>..<HASH> 100644
--- a/zstandard/cffi.py
+++ b/zstandard/cffi.py
@@ -489,10 +489,6 @@ class ZstdCompressionWriter(object):
return False
def memory_size(self):
- if not self._entered:
- raise ZstdError('cannot determine size of an inactive compressor; '
- 'call when a context manager is active')
-
return lib.ZSTD_sizeof_CCtx(self._compressor._cctx)
def write(self, data): | compressionwriter: don't require active context manager to call memory_size()
In preparation for making the context manager optional. | indygreg_python-zstandard | train | py |
bec5dc97a02103316981ae3fb58094f8be1e821e | diff --git a/core/Piwik.php b/core/Piwik.php
index <HASH>..<HASH> 100644
--- a/core/Piwik.php
+++ b/core/Piwik.php
@@ -202,7 +202,7 @@ class Piwik
if (!empty($codeImpl['httpsPiwikUrl'])) {
$setTrackerUrl = 'var u=(("https:" == document.location.protocol) ? "https://{$httpsPiwikUrl}/" : '
- . '"http://{$httpsPiwikUrl}/");';
+ . '"http://{$piwikUrl}/");';
} else {
$setTrackerUrl = 'var u=(("https:" == document.location.protocol) ? "https" : "http") + "://{$piwikUrl}";';
} | Fix another bug in core/Piwik.php's tracking code generation (use http URL for http procol when https domain is different from http). | matomo-org_matomo | train | php |
899d63b997094f066ffd49a3e58d29c07143999d | diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/testing/performance.rb
+++ b/activesupport/lib/active_support/testing/performance.rb
@@ -8,16 +8,20 @@ require 'rails/version'
module ActiveSupport
module Testing
module Performance
- benchmark = ARGV.include?('--benchmark') # HAX for rake test
-
- DEFAULTS = {
- :benchmark => benchmark,
- :runs => benchmark ? 10 : 1,
- :min_percent => 0.02,
- :metrics => [:process_time, :wall_time, :cpu_time, :memory, :objects],
- :formats => [:flat, :graph_html, :call_tree],
- :output => 'tmp/performance'
- }
+ DEFAULTS =
+ if benchmark = ARGV.include?('--benchmark') # HAX for rake test
+ { :benchmark => true,
+ :runs => 10,
+ :metrics => [:process_time, :memory, :objects],
+ :output => 'tmp/performance' }
+ else
+ { :benchmark => false,
+ :runs => 1,
+ :min_percent => 0.02,
+ :metrics => [:wall_time, :memory, :objects],
+ :formats => [:flat, :graph_html, :call_tree],
+ :output => 'tmp/performance' }
+ end
def self.included(base)
base.class_inheritable_hash :profile_options | process time for benchmarks (quicker), wall time for profiling (lower overhead) | rails_rails | train | rb |
00120e21066dd71f72252e970e56f6385b751c36 | diff --git a/rpc/amqp-rpc.go b/rpc/amqp-rpc.go
index <HASH>..<HASH> 100644
--- a/rpc/amqp-rpc.go
+++ b/rpc/amqp-rpc.go
@@ -272,7 +272,7 @@ func AmqpChannel(conf cmd.Config) (*amqp.Channel, error) {
// If the Insecure flag is true, then just go ahead and connected
conn, err = amqp.Dial(conf.AMQP.Server)
} else {
- // The insecure flag is false, so we need to load up the options
+ // The insecure flag is false or not set, so we need to load up the options
log.Info("AMQPS: Loading TLS Options.")
if strings.HasPrefix(conf.AMQP.Server, "amqps") == false { | Clarifying a comment: if the insecure flag is not set we default to assuming secure (and requiring AMQPS in the URL and the TLS config info to be set) | letsencrypt_boulder | train | go |
46b46184b10b10bdf129fd52c9d7b6aa2c0f9965 | diff --git a/src/i18n/ro.js b/src/i18n/ro.js
index <HASH>..<HASH> 100644
--- a/src/i18n/ro.js
+++ b/src/i18n/ro.js
@@ -68,8 +68,8 @@ export default {
invalidErrorHint: 'Invalid',
lastLoginInstructions: 'Ultima oară când te-ai conectat',
loginAtLabel: ' Autentifică-te cu %s',
- loginLabel: 'Autentificat',
- loginSubmitLabel: 'Autentificat',
+ loginLabel: 'Autentifică-te',
+ loginSubmitLabel: 'Autentifică-te',
loginWithLabel: ' Autentifică-te cu %s',
notYourAccountAction: 'Nu este contul tău?',
passwordInputPlaceholder: 'parola ta', | Update ro.js (#<I>) | auth0_lock | train | js |
561c010cf140bae84891a4f2d41d3ff335fbae2c | diff --git a/convert.go b/convert.go
index <HASH>..<HASH> 100644
--- a/convert.go
+++ b/convert.go
@@ -77,6 +77,17 @@ func convertToString(val reflect.Value, options reflect.StructTag) string {
func convert(val string, retval reflect.Value, options reflect.StructTag) error {
tp := retval.Type()
+ // Support for time.Duration
+ if tp == reflect.TypeOf((*time.Duration)(nil)).Elem() {
+ parsed, err := time.ParseDuration(val)
+
+ if err != nil {
+ return err
+ }
+
+ retval.SetInt(int64(parsed))
+ }
+
switch tp.Kind() {
case reflect.String:
retval.SetString(val)
@@ -168,19 +179,6 @@ func convert(val string, retval reflect.Value, options reflect.StructTag) error
retval.SetMapIndex(reflect.Indirect(keyval), reflect.Indirect(valueval))
}
- // Special cases
-
- // Support for time.Duration
- if tp == reflect.TypeOf((*time.Duration)(nil)).Elem() {
- parsed, err := time.ParseDuration(val)
-
- if err != nil {
- return err
- }
-
- retval.SetInt(int64(parsed))
- }
-
return nil
} | Move special convert cases up
This is needed for types which are aliases to primitive
types because otherwise they are simply caught in
the main switch. time.Duration is an example of this. | jessevdk_go-flags | train | go |
63fffab715f66b15e91f5b7b0665e6b68b030c34 | diff --git a/packages/react/mixins/mixin.core.js b/packages/react/mixins/mixin.core.js
index <HASH>..<HASH> 100644
--- a/packages/react/mixins/mixin.core.js
+++ b/packages/react/mixins/mixin.core.js
@@ -8,12 +8,6 @@ module.exports = class ReactMixin extends Mixin {
fileLoaderConfig.exclude.push(/\.jsx$/);
jsLoaderConfig.test.push(/\.jsx$/);
- jsLoaderConfig.exclude.push(
- /node_modules\/react-helmet/,
- /node_modules\/react-dom/,
- /node_modules\/react/
- );
-
jsLoaderConfig.options.presets.push(require.resolve('@babel/preset-react'));
if (target !== 'develop' && process.env.NODE_ENV === 'production') { | fix: do not exclude packages from transpilation
they include code that needs polyfills
that we would miss if we ignore them | untool_untool | train | js |
f511d54e2f40744e7232266f961a5ef6e317bad9 | diff --git a/app/ui/components/RunLog.js b/app/ui/components/RunLog.js
index <HASH>..<HASH> 100644
--- a/app/ui/components/RunLog.js
+++ b/app/ui/components/RunLog.js
@@ -41,7 +41,7 @@ export default function RunLog (props) {
return (
<main className={classnames(style, styles.wrapper)}>
{protocolCommands.map((command, index) =>
- <p key={command.timestamp} className={classnames({ [styles.current]: currentCommandIndex === index })}>{command.timestamp} : {command.command_description}</p>
+ <p key={command.uid} className={classnames({ [styles.current]: currentCommandIndex === index })}>{command.timestamp} : {command.command_description}</p>
)}
</main>
) | link key to uid nto timestamp | Opentrons_opentrons | train | js |
cb70e429bf5f635de2c1f282d7fd49f6097af18c | diff --git a/src/definition/formatter/number.js b/src/definition/formatter/number.js
index <HASH>..<HASH> 100644
--- a/src/definition/formatter/number.js
+++ b/src/definition/formatter/number.js
@@ -1,8 +1,14 @@
-let numeral = require('numeral');
+const numeral = require('numeral');
const DEFAULT_FORMAT = '0,0';
module.exports = {
+ /**
+ * Format a number using a given format.
+ * @param {number} number - The number to format.
+ * @param {string} format - The format to transform.
+ * @return {string} - The formated number.
+ */
format(number, format) {
format = format || DEFAULT_FORMAT;
return numeral(number).format(format); | [eslint] clean definition/entity/formatter | KleeGroup_focus-core | train | js |
5af7f20f85f3e7b26aa62552953c5913a87452d2 | diff --git a/activejdbc/src/main/java/org/javalite/activejdbc/DB.java b/activejdbc/src/main/java/org/javalite/activejdbc/DB.java
index <HASH>..<HASH> 100644
--- a/activejdbc/src/main/java/org/javalite/activejdbc/DB.java
+++ b/activejdbc/src/main/java/org/javalite/activejdbc/DB.java
@@ -394,7 +394,8 @@ public class DB {
PreparedStatement ps;
ResultSet rs;
try {
- ps = connection().prepareStatement(query);
+ ps = connection().prepareStatement(query, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
+ ps.setFetchSize(Integer.MIN_VALUE);
for (int index = 0; index < params.length; index++) {
Object param = params[index];
ps.setObject(index + 1, param);
@@ -420,7 +421,8 @@ public class DB {
Statement s = null;
ResultSet rs = null;
try {
- s = connection().createStatement();
+ s = connection().createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
+ s.setFetchSize(Integer.MIN_VALUE);
rs = s.executeQuery(sql);
RowProcessor p = new RowProcessor(rs, s);
p.with(listener); | Issue <I>: create statement and set fetch size, so that result set is streamed in DB.find with RowListener | javalite_activejdbc | train | java |
622922d5099a8fa70553cff8d25766d0b911742e | diff --git a/lib/appsignal/version.rb b/lib/appsignal/version.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/version.rb
+++ b/lib/appsignal/version.rb
@@ -1,5 +1,5 @@
require 'yaml'
module Appsignal
- VERSION = '1.1.0.beta.8'
+ VERSION = '1.1.0.beta.9'
end | Bump to <I>.beta<I> [ci skip] | appsignal_appsignal-ruby | train | rb |
90074750e9c5c8d3684eecaa3b1ad7ec8345bfcc | diff --git a/lib/core/Canvas.js b/lib/core/Canvas.js
index <HASH>..<HASH> 100644
--- a/lib/core/Canvas.js
+++ b/lib/core/Canvas.js
@@ -954,14 +954,7 @@ Canvas.prototype.getAbsoluteBBox = function(element) {
if (element.waypoints) {
var gfx = this.getGraphics(element);
- var transformBBox = gfx.getBBox(true);
bbox = gfx.getBBox();
-
- bbox.x -= transformBBox.x;
- bbox.y -= transformBBox.y;
-
- bbox.width += 2 * transformBBox.x;
- bbox.height += 2 * transformBBox.y;
}
// shapes
// use data | fix(canvas): remove parameter from getBBox which doesn't take parameters
* was previously used for Snap.svg | bpmn-io_diagram-js | train | js |
fe6339ff9c9f4abbbade01f4f6aba5cf4758df32 | diff --git a/abydos/distance/_unknown_f.py b/abydos/distance/_unknown_f.py
index <HASH>..<HASH> 100644
--- a/abydos/distance/_unknown_f.py
+++ b/abydos/distance/_unknown_f.py
@@ -175,14 +175,10 @@ class UnknownF(_TokenDistance):
part1 = a / n
if part1 == 0:
part1 = 1
- part2 = (a + b) / n
- if part2 == 0:
- part2 = 1
- part3 = (a + c) / n
- if part3 == 0:
- part3 = 1
-
- return min(1.0, 1 + log(part1) - (log(part2) + log(part3)) / 2)
+
+ return min(
+ 1.0, 1 + log(part1) - (log((a + b) / n) + log((a + c) / n)) / 2
+ )
if __name__ == '__main__': | the corner cases this adjusts for are covered by the first lines of the method | chrislit_abydos | train | py |
7a1f548a9fb7a9f766c65cd03d08a897f60bcfd7 | diff --git a/test/sg_release_test.js b/test/sg_release_test.js
index <HASH>..<HASH> 100644
--- a/test/sg_release_test.js
+++ b/test/sg_release_test.js
@@ -122,7 +122,6 @@ exports.sg_release = {
testCreateNewBranch: function (test) {
test.expect(1);
- var releaseVersion = '1.2.0';
gitHelper.createBranch(grunt, dir, releaseBranchName, function () {
exec('git branch', {
grunt: grunt,
@@ -202,7 +201,27 @@ exports.sg_release = {
test.notEqual(stdout.indexOf('Already up-to-date'), -1);
test.done();
});
- }
+ },
+
+
+ // ---
+
+
+ testRemoveBranch: function (test) {
+ test.expect(1);
+
+ gitHelper.deleteBranch(grunt, dir, releaseBranchName, function () {
+ exec('git branch', {
+ grunt: grunt,
+ dir: dir,
+ done: function (stdout) {
+ // output should contain the new branch name
+ test.equal(stdout.indexOf(releaseBranchName), -1);
+ test.done();
+ }
+ });
+ });
+ },
}; | Added tests for deleting of temp release branch | SunGard-Labs_grunt-sg-release | train | js |
57a513a6b1697d42db46b90d86a7a93e8b508ffc | diff --git a/tests_tf/test_mnist_tutorial_tf.py b/tests_tf/test_mnist_tutorial_tf.py
index <HASH>..<HASH> 100644
--- a/tests_tf/test_mnist_tutorial_tf.py
+++ b/tests_tf/test_mnist_tutorial_tf.py
@@ -39,7 +39,7 @@ class TestMNISTTutorialTF(CleverHansTest):
atol=atol_fac * 5e-3)
self.assertClose(report.train_adv_train_clean_eval,
report_2.train_adv_train_clean_eval,
- atol=atol_fac * 5e-3)
+ atol=atol_fac * 2e-2)
self.assertClose(report.train_adv_train_adv_eval,
report_2.train_adv_train_adv_eval,
atol=atol_fac * 2e-2) | Loose the check for mnist tutorial test so that the test can pass. | tensorflow_cleverhans | train | py |
97d0350a7fc34b04696224742b36cd01627b0ff9 | diff --git a/slick.grid.js b/slick.grid.js
index <HASH>..<HASH> 100644
--- a/slick.grid.js
+++ b/slick.grid.js
@@ -975,8 +975,8 @@ if (typeof Slick === "undefined") {
unregisterPlugin(plugins[i]);
}
- if (options.enableColumnReorder && $headers.sortable) {
- $headers.sortable("destroy");
+ if (options.enableColumnReorder) {
+ $headers.filter(":ui-sortable").sortable("destroy");
}
unbindAncestorScrollEvents(); | Applied fix to destroy error with JQuery <I>. | coatue-oss_slickgrid2 | train | js |
80c838f4aa548f92773602d64dc5a35421031ab0 | diff --git a/structr-ui/src/main/java/org/structr/web/maintenance/DeployCommand.java b/structr-ui/src/main/java/org/structr/web/maintenance/DeployCommand.java
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/java/org/structr/web/maintenance/DeployCommand.java
+++ b/structr-ui/src/main/java/org/structr/web/maintenance/DeployCommand.java
@@ -262,7 +262,7 @@ public class DeployCommand extends NodeServiceCommand implements MaintenanceComm
info("Reading {}..", schemaMethodsConf);
final String title = "Deprecation warning";
- final String text = "Newer versions store global schema methods in the schema snapshot file. Recreate the export with the current version to avoid compatibility issues. Support for importing this file will be dropped in future versions.";
+ final String text = "Found file 'schema-methods.json'. Newer versions store global schema methods in the schema snapshot file. Recreate the export with the current version to avoid compatibility issues. Support for importing this file will be dropped in future versions.";
final Map<String, Object> deprecationBroadcastData = new TreeMap();
deprecationBroadcastData.put("type", "WARNING"); | Added more context to deprecation warning during deployment import | structr_structr | train | java |
1bdbd1f5a76a642dece3fa26bf286bc4a9fc50a8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -354,9 +354,11 @@ def locate_cuda():
if 'CUDA_HOME' in os.environ:
home = os.environ['CUDA_HOME']
nvcc = os.path.join(home, 'bin', 'nvcc')
+ elif os.path.exists(os.path.join('usr', 'local', 'cuda', 'bin', 'nvcc')):
+ nvcc = os.path.join('usr', 'local', 'cuda', 'bin', 'nvcc')
else:
# otherwise, search the PATH for NVCC
- nvcc = find_in_path('nvcc', os.environ['PATH'])
+ nvcc = find_in_paths('nvcc', os.environ['PATH'])
if nvcc is None:
print('Warning: The nvcc binary could not be located in your $PATH. '
'For GPU capability, either add it to your path, or set $CUDA_HOME') | Be a bit smarter about finding nvcc | explosion_thinc | train | py |
dff8e11d8e95a4b1a8cd55a49cd7c3fd457585c6 | diff --git a/metric/metric.go b/metric/metric.go
index <HASH>..<HASH> 100644
--- a/metric/metric.go
+++ b/metric/metric.go
@@ -34,12 +34,6 @@ func (name Metric) Send(value int) error {
return metrics.SendValue(string(name), float64(value), "Metric")
}
-type Requests string
-
-func (name Requests) Send(value int) error {
- return metrics.SendValue(string(name), float64(value), "Req")
-}
-
type BytesPerSecond string
func (name BytesPerSecond) Send(value float64) error { | Remove 'Requests' type from metrics.
[finishes #<I>] | cloudfoundry_runtimeschema | train | go |
52d9bb9ed84442cc89df302a200e136819735e5f | diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py
index <HASH>..<HASH> 100644
--- a/pandas/io/formats/style.py
+++ b/pandas/io/formats/style.py
@@ -158,13 +158,12 @@ class Styler:
uuid_len: int = 5,
):
# validate ordered args
- if not isinstance(data, (pd.Series, pd.DataFrame)):
- raise TypeError("``data`` must be a Series or DataFrame")
- if data.ndim == 1:
+ if isinstance(data, pd.Series):
data = data.to_frame()
+ if not isinstance(data, DataFrame):
+ raise TypeError("``data`` must be a Series or DataFrame")
if not data.index.is_unique or not data.columns.is_unique:
raise ValueError("style is not supported for non-unique indices.")
- assert isinstance(data, DataFrame)
self.data: DataFrame = data
self.index: pd.Index = data.index
self.columns: pd.Index = data.columns | typing refactor (#<I>) | pandas-dev_pandas | train | py |
6982ae627b8ceb0f1fb3ac59ff5351b27912769f | diff --git a/packages/core/src/plugins/input/csl.js b/packages/core/src/plugins/input/csl.js
index <HASH>..<HASH> 100644
--- a/packages/core/src/plugins/input/csl.js
+++ b/packages/core/src/plugins/input/csl.js
@@ -273,12 +273,17 @@ const correctDate = function (date, bestGuessConversions) {
* @access private
* @memberof module:@citation-js/core.plugins.input.util
*
- * @param {String} type - type
+ * @param {String|*} type - type
* @param {Boolean} bestGuessConversions - make some best guess conversions on type mismatch
*
* @return {String|undefined} returns the (corrected) value if possible, otherwise undefined
*/
const correctType = function (type, bestGuessConversions) {
+ // Also anything that can be converted to a string. Taking `language` as a field
+ // with similar string constraints, as fields like `title` might take HTML into
+ // account in the future.
+ type = correctField('language', type, bestGuessConversions)
+
if (entryTypes[type] === true) {
return type
} else if (bestGuessConversions && type in entryTypes) { | fix(core): clean `type` as regular string
Still allow regular string-fixing operations on type fields, on top of
content-specific corrections.
See <I>b<I>b5d<I>cfab<I>dac<I>bb<I>c0c<I>e<I> | citation-js_citation-js | train | js |
b364e09ab8e3422e52b7c3e011e3d24150142549 | diff --git a/masonite/view.py b/masonite/view.py
index <HASH>..<HASH> 100644
--- a/masonite/view.py
+++ b/masonite/view.py
@@ -188,8 +188,8 @@ class View:
Keyword Arguments:
loader {jinja2.Loader} -- Type of Jinja2 loader to use. (default: {jinja2.PackageLoader})
- """ # loader(package_name, location)
- # /dashboard/templates/dashboard
+ """
+
if loader == PackageLoader:
template_location = template_location.split(self._splice) | remove commented code from L<I> and L<I> in view.py | MasoniteFramework_masonite | train | py |
2922c0956097a3031a16a3df3799ca0bbe067561 | diff --git a/lib/mongo/auth/sasl_conversation_base.rb b/lib/mongo/auth/sasl_conversation_base.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/auth/sasl_conversation_base.rb
+++ b/lib/mongo/auth/sasl_conversation_base.rb
@@ -54,7 +54,7 @@ module Mongo
user.auth_source,
Database::COMMAND,
selector,
- limit: 1,
+ limit: -1,
)
end
end | RUBY-<I> switch back to limit of -1 to indicate the expectation of a single batch (#<I>) | mongodb_mongo-ruby-driver | train | rb |
61732d1429f9284defa3c9839d52eb1f3c4541fe | diff --git a/flask_simpleldap/__init__.py b/flask_simpleldap/__init__.py
index <HASH>..<HASH> 100644
--- a/flask_simpleldap/__init__.py
+++ b/flask_simpleldap/__init__.py
@@ -330,7 +330,7 @@ class LDAP(object):
next=request.full_path or request.path))
match = [group for group in groups if group in g.ldap_groups]
if not match:
- abort(401)
+ abort(403)
return func(*args, **kwargs) | Issue #<I>: group_required not working as expected
- fixes #<I> | admiralobvious_flask-simpleldap | train | py |
2d0c5dd484e7621a9859ab40ac43d25a1f5f5078 | diff --git a/docker/models/services.py b/docker/models/services.py
index <HASH>..<HASH> 100644
--- a/docker/models/services.py
+++ b/docker/models/services.py
@@ -276,7 +276,7 @@ CONTAINER_SPEC_KWARGS = [
'labels',
'mounts',
'open_stdin',
- 'privileges'
+ 'privileges',
'read_only',
'secrets',
'stop_grace_period', | Adding missing comma in spec list.
Fixing #<I>, syntax error caused by missing comma on CONTAINER_SPEC_KWARGS list. | docker_docker-py | train | py |
Subsets and Splits