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
|
---|---|---|---|---|---|
25d70cc96bc044e5b8623f8aa9a2d3fc17b9b7e5 | diff --git a/master/buildbot/db/model.py b/master/buildbot/db/model.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/db/model.py
+++ b/master/buildbot/db/model.py
@@ -18,8 +18,8 @@ from __future__ import print_function
import migrate
import migrate.versioning.repository
-from migrate import exceptions
import sqlalchemy as sa
+from migrate import exceptions # pylint: disable=ungrouped-imports
from twisted.python import log
from twisted.python import util | revert import order to make isort happy | buildbot_buildbot | train | py |
9e27807bed8c40312fb64676197ba5a560171ad9 | diff --git a/lib/tests/lock_test.php b/lib/tests/lock_test.php
index <HASH>..<HASH> 100644
--- a/lib/tests/lock_test.php
+++ b/lib/tests/lock_test.php
@@ -91,7 +91,7 @@ class lock_testcase extends advanced_testcase {
$lock2 = $lockfactory->get_lock('abc', 2);
$duration += microtime(true);
$this->assertFalse($lock2, 'Cannot get a stacked lock');
- $this->assertTrue($duration > 1, 'Lock should timeout after more than 1 second');
+ $this->assertTrue($duration < 2.5, 'Lock should timeout after no more than 2 seconds');
// This should timeout almost instantly.
$duration = -microtime(true); | MDL-<I> locks: Fixed backwards unit tests for unstacked locks | moodle_moodle | train | php |
111af38fb10cc35c7a62d7338d908473bc92bd49 | diff --git a/src/Illuminate/Exception/Handler.php b/src/Illuminate/Exception/Handler.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Exception/Handler.php
+++ b/src/Illuminate/Exception/Handler.php
@@ -313,9 +313,14 @@ class Handler {
*/
protected function formatException(\Exception $e)
{
- $location = $e->getMessage().' in '.$e->getFile().':'.$e->getLine();
+ if ($this->debug)
+ {
+ $location = $e->getMessage().' in '.$e->getFile().':'.$e->getLine();
+
+ return 'Error in exception handler: '.$location;
+ }
- return 'Error in exception handler: '.$location;
+ return 'Error in exception handler.';
}
/** | scale back erorr message when debug is set to false and error occurs in exception handler. | laravel_framework | train | php |
755c5ac99dac9d5ab4f94fe204f02f44d02121da | diff --git a/test/cook_test.rb b/test/cook_test.rb
index <HASH>..<HASH> 100644
--- a/test/cook_test.rb
+++ b/test/cook_test.rb
@@ -23,6 +23,15 @@ class CookTest < TestCase
assert_instance_of Chef::Cookbook::Chefignore, command.chefignore
end
+ def test_rsync_exclude_sources_chefignore
+ in_kitchen do
+ file_to_ignore = "dummy.txt"
+ File.open(file_to_ignore, 'w') {|f| f.puts "This file should be ignored"}
+ File.open("chefignore", 'w') {|f| f.puts file_to_ignore}
+ assert command.rsync_exclude.include?(file_to_ignore), "#{file_to_ignore} should have been excluded"
+ end
+ end
+
def test_barks_without_atleast_a_hostname
in_kitchen do
assert_raises KnifeSolo::KnifeSoloError do | Re-add `test_barks_without_atleast_a_hostname`
The test was accidentally removed by commit
<I>c8fd4af<I>ba<I>d<I>d<I>b7e0b<I>eb as it was also using the same
files as syntax error tests. | matschaffer_knife-solo | train | rb |
45b9a9a18b8d145e928203e0a534c9366ace9888 | diff --git a/salt/loader.py b/salt/loader.py
index <HASH>..<HASH> 100644
--- a/salt/loader.py
+++ b/salt/loader.py
@@ -403,11 +403,13 @@ def states(opts, functions, whitelist=None):
__opts__ = salt.config.minion_config('/etc/salt/minion')
statemods = salt.loader.states(__opts__, None)
'''
- return LazyLoader(_module_dirs(opts, 'states', 'states'),
+ ret = LazyLoader(_module_dirs(opts, 'states', 'states'),
opts,
tag='states',
pack={'__salt__': functions},
whitelist=whitelist)
+ ret.pack['__states__'] = ret
+ return ret
def beacons(opts, functions, context=None): | Add __states__ to state modules, for cross-calling states | saltstack_salt | train | py |
22eb6c910d92a61f3ff82bc116597be9ce27bafd | diff --git a/pythonforandroid/archs.py b/pythonforandroid/archs.py
index <HASH>..<HASH> 100644
--- a/pythonforandroid/archs.py
+++ b/pythonforandroid/archs.py
@@ -289,6 +289,7 @@ class Archx86_64(Arch):
'-mpopcnt',
'-m64',
'-mtune=intel',
+ '-fPIC',
] | :bug: Add `-fPIC` to `CFLAGS` for Arch `x<I>_<I>` (#<I>)
Since, at this point, we know that we need to add the mentioned flags at
some point, let's be brave and try to add it at Arch level (since we
need `-fPIC` for `ArchARMv7_a` it may be also the case for `Archx<I>_<I>`)
**See also:**
- <URL> | kivy_python-for-android | train | py |
6cebce066e4aebbdc719dc43bcce7c696f82961e | diff --git a/tests/Database.php b/tests/Database.php
index <HASH>..<HASH> 100644
--- a/tests/Database.php
+++ b/tests/Database.php
@@ -25,6 +25,7 @@ use Leevel\Database\Manager;
use Leevel\Database\Mysql;
use Leevel\Di\Container;
use Leevel\Di\IContainer;
+use Leevel\Event\IDispatch;
use Leevel\Option\Option;
use PDO;
@@ -160,6 +161,13 @@ eot;
$container->singleton('option', $option);
+ $eventDispatch = $this->createMock(IDispatch::class);
+
+ $eventDispatch->method('handle')->willReturn(null);
+ $this->assertNull($eventDispatch->handle('event'));
+
+ $container->singleton(IDispatch::class, $eventDispatch);
+
return $manager;
} | fixed tests of validate and some of database | hunzhiwange_framework | train | php |
c02afde9199bc95c003458bc37068b036138364c | diff --git a/fabfile.py b/fabfile.py
index <HASH>..<HASH> 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -966,12 +966,10 @@ def deploy(resetAfterwards=True):
run_custom(env.config, 'deploy')
- slack(env.config, 'deploy', 'Deployment finished sucessfully')
-
-
if resetAfterwards and resetAfterwards != '0':
reset()
+ slack(env.config, 'deploy', 'Deployment finished sucessfully')
@task | Dispatch slack notification when deployment is finisheda | factorial-io_fabalicious | train | py |
778138ec2e65bcf41a32d5a9a4e4bdbecc280656 | diff --git a/Service/Bonus/Collect/A/CreateOperation.php b/Service/Bonus/Collect/A/CreateOperation.php
index <HASH>..<HASH> 100644
--- a/Service/Bonus/Collect/A/CreateOperation.php
+++ b/Service/Bonus/Collect/A/CreateOperation.php
@@ -53,12 +53,12 @@ class CreateOperation
$trans = [];
$tranBonus = new ETrans();
if ($isBounty) {
- $note = "Ref. bonus bounty for sale order #$saleInc ($referral).";
+ $note = "Referral bonus for order #$saleInc by $referral.";
$operType = Cfg::CODE_TYPE_OPER_BONUS_REF_BOUNTY;
$accDebit = $accIdSys;
$accCredit = $accIdCust;
} else {
- $note = "Ref. bonus fee for sale order #$saleInc ($referral).";
+ $note = "Referral bonus fee for order #$saleInc by $referral.";
$operType = Cfg::CODE_TYPE_OPER_BONUS_REF_FEE;
$accDebit = $accIdCust;
$accCredit = $accIdSys; | SAN-<I> Ref bonus bounty missing info | praxigento_mobi_mod_bonus_referral | train | php |
7a1e2827c8c2725c527f7fb07e94db7c6a1c0ae4 | diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py
index <HASH>..<HASH> 100644
--- a/trezorlib/tx_api.py
+++ b/trezorlib/tx_api.py
@@ -30,7 +30,10 @@ def bitcore_tx(url):
for vout in data['vout']:
o = t.outputs.add()
o.amount = int(vout['value'] * 100000000)
- asm = vout['scriptPubKey']['asm'].split(' ') # we suppose it's OP_DUP OP_HASH160 pubkey OP_EQUALVERIFY OP_CHECKSIG
+ asm = vout['scriptPubKey']['asm'].split(' ')
+ # we suppose it's OP_DUP OP_HASH160 pubkey OP_EQUALVERIFY OP_CHECKSIG
+ if len(asm) != 5 or asm[0] != 'OP_DUP' or asm[1] != 'OP_HASH160' or asm[3] != 'OP_EQUALVERIFY' or asm[4] != 'OP_CHECKSIG':
+ raise Exception('Unknown scriptPubKey asm: %s' % asm)
o.script_pubkey = binascii.unhexlify('76a914' + asm[2] + '88ac')
return t | check for known scriptPubKey asm | trezor_python-trezor | train | py |
f4e051fe6c9e77c0521d9d3593bc4847790a7d89 | diff --git a/server/camlistored/ui/index.js b/server/camlistored/ui/index.js
index <HASH>..<HASH> 100644
--- a/server/camlistored/ui/index.js
+++ b/server/camlistored/ui/index.js
@@ -334,9 +334,7 @@ cam.IndexPage = React.createClass({
},
handleDetailURL_: function(blobref) {
- var m = this.searchSession_.getMeta(blobref);
- var rm = this.searchSession_.getResolvedMeta(blobref);
- return this.getDetailURL_(m.blobRef);
+ return this.getDetailURL_(blobref);
},
getDetailURL_: function(blobref) { | ui: fix <I>, error in container aspect when children aren't in searchSession
Change-Id: I<I>e<I>bc1f1b1bd<I>a8afedb8da8f9dcdb<I> | perkeep_perkeep | train | js |
f7b9ac2fc6574c98fd81866f670860da8eeeca67 | diff --git a/socialregistration/contrib/google/auth.py b/socialregistration/contrib/google/auth.py
index <HASH>..<HASH> 100644
--- a/socialregistration/contrib/google/auth.py
+++ b/socialregistration/contrib/google/auth.py
@@ -4,10 +4,14 @@ from django.contrib.auth.backends import ModelBackend
class GoogleAuth(ModelBackend):
- def authenticate(self, id = None):
+ supports_object_permissions = False
+ supports_anonymous_user = False
+
+ def authenticate(self, **kwargs):
+ uid = kwargs.get('google_id')
try:
return GoogleProfile.objects.get(
- google_id = id,
+ google_id = uid,
site = Site.objects.get_current()).user
except GoogleProfile.DoesNotExist:
return None | Made Google auth find existing profiles so we can log people in with it | flashingpumpkin_django-socialregistration | train | py |
052faffc345ebb0c02ad23af9e6c1caee2c07ff1 | diff --git a/src/StreamSubject.php b/src/StreamSubject.php
index <HASH>..<HASH> 100644
--- a/src/StreamSubject.php
+++ b/src/StreamSubject.php
@@ -30,7 +30,6 @@ class StreamSubject extends Subject
}
-
public function onNext($data)
{
@@ -40,9 +39,6 @@ class StreamSubject extends Subject
$this->stream->write($data);
- //this will probably get stuck in a loop, not sure if I need it or not
- parent::onNext($data);
-
}
public function onCompleted() | Removed unnecessary onNext in StreamSubject | RxPHP_RxStream | train | php |
21244b39d3940452dc8941a91d50ea7a0df6add0 | diff --git a/pure/src/test/java/com/github/tonivade/zeromock/api/HttpZIOServiceTest.java b/pure/src/test/java/com/github/tonivade/zeromock/api/HttpZIOServiceTest.java
index <HASH>..<HASH> 100644
--- a/pure/src/test/java/com/github/tonivade/zeromock/api/HttpZIOServiceTest.java
+++ b/pure/src/test/java/com/github/tonivade/zeromock/api/HttpZIOServiceTest.java
@@ -32,7 +32,8 @@ public class HttpZIOServiceTest {
@Test
public void echo() {
HttpZIOService<Nothing> service = new HttpZIOService<>("test", Nothing::nothing)
- .when(get("/echo")).then(request -> Task.from(request::body).fold(Responses::error, Responses::ok).toZIO());
+ .when(get("/echo"))
+ .then(request -> Task.from(request::body).fold(Responses::error, Responses::ok).<Nothing>toZIO());
Option<Promise<HttpResponse>> execute = service.execute(Requests.get("/echo").withBody(asBytes("hello"))); | trying to fix compilation in travis/jenkins | tonivade_zeromock | train | java |
d26742f81e4fc725ab4bfef000c2eee783bab656 | diff --git a/src/CodeGen/Parser/Schema/Xpath.php b/src/CodeGen/Parser/Schema/Xpath.php
index <HASH>..<HASH> 100644
--- a/src/CodeGen/Parser/Schema/Xpath.php
+++ b/src/CodeGen/Parser/Schema/Xpath.php
@@ -48,7 +48,7 @@ class Xpath extends DOMXpath
// Build regular expression (naming rules @ http://www.xml.com/pub/a/2001/07/25/namingparts.html)
// Charset for nodes name, except for the first letter (that just supports '\w')
- $charset = '[\w-.]';
+ $charset = '[\w\-.]';
// Redefine boundaries
$look_behind = '(?<!'.$charset.')';
$look_ahead = '(?!'.$charset.')'; | php <I> compat: fix unescaped hyphen in regex
this wasn't a problem prior to php<I>, but was wrong nonetheless as the
hyphen is only allowed unescaped in ranges when it is at the end of the
range iirc. | honeybee_trellis | train | php |
d9d77c4fa6db02638fa399304d76aab70c66066e | diff --git a/CordovaLib/cordova.js b/CordovaLib/cordova.js
index <HASH>..<HASH> 100644
--- a/CordovaLib/cordova.js
+++ b/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 2.8.0-0-g6208c95
+// 2.7.0rc1-75-g76065a1
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var CORDOVA_JS_BUILD_LABEL = '2.8.0-0-g6208c95';
+var CORDOVA_JS_BUILD_LABEL = '2.7.0rc1-75-g76065a1';
// file: lib/scripts/require.js
var require,
@@ -2383,7 +2383,11 @@ function initRead(reader, file) {
reader._error = null;
reader._readyState = FileReader.LOADING;
- if (typeof file.fullPath == 'string') {
+ if (typeof file == 'string') {
+ // Deprecated in Cordova 2.4.
+ console.warn('Using a string argument with FileReader.readAs functions is deprecated.');
+ reader._fileName = file;
+ } else if (typeof file.fullPath == 'string') {
reader._fileName = file.fullPath;
} else {
reader._fileName = ''; | Update JS snapshot to version <I>rc1 | apache_cordova-ios | train | js |
0d2b2024d6f2c18700b24943d815dab4c83ccd49 | diff --git a/upload/catalog/model/account/returns.php b/upload/catalog/model/account/returns.php
index <HASH>..<HASH> 100644
--- a/upload/catalog/model/account/returns.php
+++ b/upload/catalog/model/account/returns.php
@@ -30,7 +30,7 @@ class Returns extends \Opencart\System\Engine\Model {
public function getTotalReturns(): int {
$query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "return` WHERE `customer_id` = '" . $this->customer->getId() . "'");
- return $query->row['total'];
+ return (int)$query->row['total'];
}
public function getHistories(int $return_id): array { | Added sanitized int on total | opencart_opencart | train | php |
213cfe8c8401bed8cd84756ff019d1f5b48ad94f | diff --git a/src/js/media.js b/src/js/media.js
index <HASH>..<HASH> 100644
--- a/src/js/media.js
+++ b/src/js/media.js
@@ -46,21 +46,12 @@ const media = {
this.elements.wrapper.appendChild(this.elements.poster);
}
- if (this.isEmbed) {
- switch (this.provider) {
- case 'youtube':
- youtube.setup.call(this);
- break;
-
- case 'vimeo':
- vimeo.setup.call(this);
- break;
-
- default:
- break;
- }
- } else if (this.isHTML5) {
+ if (this.isHTML5) {
html5.extend.call(this);
+ } else if (this.isYouTube) {
+ youtube.setup.call(this);
+ } else if (this.isVimeo) {
+ vimeo.setup.call(this);
}
},
}; | Replace switch in media.js with simpler conditions | sampotts_plyr | train | js |
a0084ee5545239c5e04d3454a7667a127f8d584f | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -26,6 +26,7 @@ if defined?(I18n.enforce_available_locales)
end
class TestApp < Rails::Application
+# config.eager_load = false
config.root = ""
end
Rails.application = TestApp | "config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly" | haml_haml | train | rb |
81e9a7cb05414e3f1c2c3e391e4c37415fb08008 | diff --git a/alerta/common/alert.py b/alerta/common/alert.py
index <HASH>..<HASH> 100644
--- a/alerta/common/alert.py
+++ b/alerta/common/alert.py
@@ -171,7 +171,7 @@ class Alert(object):
return self.event_type
def get_severity(self):
- return self.severity, self.previous_severity
+ return self.severity
def get_create_time(self):
return self.create_time.replace(microsecond=0).isoformat() + ".%03dZ" % (self.create_time.microsecond // 1000) | only return current severity with get_severity() | alerta_alerta | train | py |
78467c5046f49009bdb7611c36e9c8f1ae593bd3 | diff --git a/Storage/SessionBackend.php b/Storage/SessionBackend.php
index <HASH>..<HASH> 100644
--- a/Storage/SessionBackend.php
+++ b/Storage/SessionBackend.php
@@ -38,9 +38,15 @@ class SessionBackend implements BackendInterface
public function __construct(SessionInterface $session, $namespace = null)
{
$this->_session = $session;
- $this->_namespace = $namespace;
- $this->_storage = new AttributeBag($this->_namespace);
- $this->_session->registerBag($this->_storage);
+ if (strlen($namespace)) {
+ $this->_namespace = $namespace;
+ }
+ $this->_session->setId('mg0ot6e35st3mk020fa7ef8u31');
+ $bag = new AttributeBag($this->_namespace);
+ $bag->setName($this->_namespace);
+ $this->_session->registerBag($bag);
+ // Bag is get back from session to allow its initialization
+ $this->_storage = $this->_session->getBag($this->_namespace);
}
/** | Fixed problem with session backend for structures storage | FlyingDR_struct-bundle | train | php |
82f578d3691b5c39ae412503d1195b2c7776e3f7 | diff --git a/ladybug/monthlychart.py b/ladybug/monthlychart.py
index <HASH>..<HASH> 100644
--- a/ladybug/monthlychart.py
+++ b/ladybug/monthlychart.py
@@ -999,6 +999,8 @@ class MonthlyChart(object):
if unit in UNITS[key]:
data_types.append(TYPESDICT[key]())
break
+ else:
+ data_types.append(GenericType)
# convert hourly data collections into monthly-per-hour collections
if self._time_interval == 'Hourly': | style(monthlychart): Ensure MonthlyChart still works with GenericType | ladybug-tools_ladybug | train | py |
e4b78037a6ea4e97be8ba08067f75bfe07860ef5 | diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py
index <HASH>..<HASH> 100644
--- a/spyderlib/spyder.py
+++ b/spyderlib/spyder.py
@@ -1506,8 +1506,12 @@ class MainWindow(QMainWindow):
</li><li>Discussions around the project:
<a href="%s">Google Group</a>
</li></ul>
- <p>This project is part of
- <a href="http://www.pythonxy.com">Python(x,y) distribution</a>
+ <p>This project is part of a larger effort to promote and
+ facilitate the use of Python for scientific and enginering
+ software development. The popular Python distributions
+ <a href="http://www.pythonxy.com">Python(x,y)</a> and
+ <a href="http://code.google.com/p/winpython/">WinPython</a>
+ also contribute to this plan.
<p>Python %s %dbits, Qt %s, %s %s on %s"""
% (versions['spyder'], revlink, __project_url__,
"<span style=\'color: #444444\'><b>", pyflakes_version, | About dialog box: changed the "This project is part of Python(x,y)" part to more
general words (which are also closer to the initial meaning of this sentence)
including a citation of WinPython | spyder-ide_spyder | train | py |
1b38c3dae8cea36168d0f7deb8354882b81cd0af | diff --git a/tests/src/Sandbox/SandboxStub.php b/tests/src/Sandbox/SandboxStub.php
index <HASH>..<HASH> 100644
--- a/tests/src/Sandbox/SandboxStub.php
+++ b/tests/src/Sandbox/SandboxStub.php
@@ -67,7 +67,7 @@ class SandboxStub extends Sandbox {
* Run the check and capture the outcomes.
*/
public function run() {
- $response = new AuditResponse($this->checkInfo);
+ $response = new AuditResponse($this->getPolicy());
$outcome = $this->getCheck()->execute($this);
$response->set($outcome, $this->getParameterTokens()); | Fixedup testing changes to reflect change in API | drutiny_drutiny | train | php |
bcbb47fcc9c69589b663b54effb130f3c5ac61cb | diff --git a/Object.php b/Object.php
index <HASH>..<HASH> 100644
--- a/Object.php
+++ b/Object.php
@@ -207,11 +207,32 @@ class Object extends \Phramework\Validate\BaseValidator
'properties' => $missingObjects
];
}
+
$return->errorObject = new IncorrectParametersException($errorObject);
- //todo here we must collect all errorObjects
+
return $return;
}
-
+
+ //Check if additionalProperties are set
+ if ($this->additionalProperties === false) {
+ $foundAdditionalProperties = [];
+
+ foreach ($valueProperties as $key => $property) {
+ if (!property_exists($this->properties, $key)) {
+ $foundAdditionalProperties[] = $key;
+ }
+ }
+ var_dump($foundAdditionalProperties);
+ if (!empty($foundAdditionalProperties)) {
+ $return->errorObject = new IncorrectParametersException([
+ 'type' => static::getType(),
+ 'failure' => 'additionalProperties',
+ 'properties' => $foundAdditionalProperties
+ ]);
+ return $return;
+ }
+ }
+
//success
$return->status = true; | Implement Object validator's additionalItems | phramework_validate | train | php |
2338b3f0db77167cd6507959810f7c311a68328f | diff --git a/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java b/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java
index <HASH>..<HASH> 100644
--- a/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java
+++ b/connector/src/main/java/org/jboss/as/connector/deployers/processors/DriverProcessor.java
@@ -80,7 +80,7 @@ public final class DriverProcessor implements DeploymentUnitProcessor {
DriverService driverService = new DriverService(driverMetadata, driver);
phaseContext
.getServiceTarget()
- .addService(ServiceName.JBOSS.append("jdbc-driver", driverName.replaceAll(".", "_")), driverService)
+ .addService(ServiceName.JBOSS.append("jdbc-driver", driverName.replaceAll("\\.", "_")), driverService)
.addDependency(ConnectorServices.JDBC_DRIVER_REGISTRY_SERVICE, DriverRegistry.class,
driverService.getDriverRegistryServiceInjector()).setInitialMode(Mode.ACTIVE).install(); | Fix bug in jdbc driver processor | wildfly_wildfly | train | java |
13da1b7b02219cb573c4ddb6f71d9d8d0239b993 | diff --git a/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java b/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
index <HASH>..<HASH> 100644
--- a/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
+++ b/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
@@ -172,7 +172,7 @@ public class SearchOptionsPanel extends FormLayout
if (config.getConfig().containsKey(KEY_DEFAULT_SEGMENTATION))
{
- lastSelection = config.getConfig().get(KEY_DEFAULT_SEGMENTATION);
+ lastSelection = config.getConfig().getProperty(KEY_DEFAULT_SEGMENTATION);
}
}
diff --git a/annis-libgui/src/main/java/annis/libgui/Helper.java b/annis-libgui/src/main/java/annis/libgui/Helper.java
index <HASH>..<HASH> 100644
--- a/annis-libgui/src/main/java/annis/libgui/Helper.java
+++ b/annis-libgui/src/main/java/annis/libgui/Helper.java
@@ -323,7 +323,6 @@ public class Helper
public static CorpusConfig getCorpusConfig(String corpus)
{
CorpusConfig corpusConfig = new CorpusConfig();
- corpusConfig.setConfig(new TreeMap<String, String>());
try
{ | Propagate the change of the REST-API to the gui and lig-gui. | korpling_ANNIS | train | java,java |
9287c687f4faad1bd50e48788eab20ddcec630c1 | diff --git a/environment/src/main/java/jetbrains/exodus/log/Log.java b/environment/src/main/java/jetbrains/exodus/log/Log.java
index <HASH>..<HASH> 100644
--- a/environment/src/main/java/jetbrains/exodus/log/Log.java
+++ b/environment/src/main/java/jetbrains/exodus/log/Log.java
@@ -606,9 +606,7 @@ public final class Log implements Closeable {
reader.removeBlock(address, rbt);
// remove address of file of the list
synchronized (blockAddrs) {
- if (!blockAddrs.remove(address)) {
- throw new ExodusException("There is no file by address " + address);
- }
+ blockAddrs.remove(address);
}
// clear cache
for (long offset = 0; offset < fileLengthBound; offset += cachePageSize) { | get rid of the guard checking if a file being removed is already removed | JetBrains_xodus | train | java |
ad336f955fa4b27f991d46376e3d6467bb42b635 | diff --git a/src/Validator/MailValidator.php b/src/Validator/MailValidator.php
index <HASH>..<HASH> 100644
--- a/src/Validator/MailValidator.php
+++ b/src/Validator/MailValidator.php
@@ -32,7 +32,6 @@ class MailValidator extends AbstractValidator
$this->clearErrors();
$this->validateSubject($mail->getSubject());
- $this->validateBody($mail->getTextBody(), $mail->getHtmlBody());
$this->validateSender($mail->getSender());
$this->validateAddress($mail->getRecipients(), 'recipients');
$this->validateAddress($mail->getCc(), 'cc', false); | Removed email body as criteria of Mail instance validation | flash-global_mailer-common | train | php |
ce1a5cd2cec781a23fa8d1c67b083b5ae447feba | diff --git a/cmd/relaysrv/status.go b/cmd/relaysrv/status.go
index <HASH>..<HASH> 100644
--- a/cmd/relaysrv/status.go
+++ b/cmd/relaysrv/status.go
@@ -52,6 +52,7 @@ func getStatus(w http.ResponseWriter, r *http.Request) {
"per-session-rate": sessionLimitBps,
"global-rate": globalLimitBps,
"pools": defaultPoolAddrs,
+ "provided-by": providedBy,
}
bs, err := json.MarshalIndent(status, "", " ") | Expose provided by in status endpoint | syncthing_syncthing | train | go |
15d7e9aa653a2a9f8cad7722cdea2b2cc6778b0c | diff --git a/tests/test_api_async.py b/tests/test_api_async.py
index <HASH>..<HASH> 100644
--- a/tests/test_api_async.py
+++ b/tests/test_api_async.py
@@ -23,7 +23,7 @@ class TestAsyncCallApi(AsyncTestCase):
self.password = os.environ.get('MYGEOTAB_PASSWORD')
self.database = os.environ.get('MYGEOTAB_DATABASE')
if self.username and self.password:
- self.api = API(self.username, password=self.password, database=self.database, loop=self.loop, verify=False)
+ self.api = API(self.username, password=self.password, database=self.database, loop=self.loop, verify=True)
self.api.authenticate()
else:
self.skipTest( | Verify all on async tests | Geotab_mygeotab-python | train | py |
43a0cc6f0bca485ffdef19b33f1d73a94abdae4c | diff --git a/Neos.Flow/Classes/Property/TypeConverter/ObjectConverter.php b/Neos.Flow/Classes/Property/TypeConverter/ObjectConverter.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/Property/TypeConverter/ObjectConverter.php
+++ b/Neos.Flow/Classes/Property/TypeConverter/ObjectConverter.php
@@ -40,14 +40,14 @@ use Neos\Utility\TypeHandling;
class ObjectConverter extends AbstractTypeConverter
{
/**
- * @var integer
+ * @var string
*/
- const CONFIGURATION_TARGET_TYPE = 3;
+ const CONFIGURATION_TARGET_TYPE = 'targetType';
/**
- * @var integer
+ * @var string
*/
- const CONFIGURATION_OVERRIDE_TARGET_TYPE_ALLOWED = 4;
+ const CONFIGURATION_OVERRIDE_TARGET_TYPE_ALLOWED = 'allowTypeOverride';
/**
* @var array | BUGFIX: Property mapping configuration keys need to be strings | neos_flow-development-collection | train | php |
ccbbe2b018be99e06fe8a58d5a4c8d5a80aec667 | diff --git a/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js b/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js
+++ b/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js
@@ -89,13 +89,7 @@ sap.ui.define([
}
}
- var bHasSelection = false;
- if (window.getSelection) {
- var oSelection = window.getSelection();
- bHasSelection = oSelection.rangeCount ? !oSelection.getRangeAt(0).collapsed : false;
- }
-
- if (bHasSelection) {
+ if (window.getSelection().toString().length > 0) {
Log.debug("DOM Selection detected -> Click event on table skipped, Target: " + oEvent.target);
return true;
} | [INTERNAL][FIX] Table: prevent click on text selection in input field
the cellClick event should be prevented when text is selected inside an
input field, but the mouse is released inside the parent cell
Change-Id: I3bc4d0e9fd6b<I>f<I>d<I>d2c1f<I>cf<I>eaa<I>b
BCP: <I> | SAP_openui5 | train | js |
2e5fb8aa5466366e210606f270421480b6d7f0fa | diff --git a/lib/opal/sprockets/processor.rb b/lib/opal/sprockets/processor.rb
index <HASH>..<HASH> 100644
--- a/lib/opal/sprockets/processor.rb
+++ b/lib/opal/sprockets/processor.rb
@@ -73,7 +73,7 @@ module Opal
result = builder.build_str(data, path, :prerequired => prerequired)
if self.class.source_map_enabled
- register_source_map(context.pathname, result.source_map)
+ register_source_map(context.logical_path, result.source_map.to_s)
"#{result.to_s}\n//# sourceMappingURL=#{context.logical_path}.map\n"
else
result.to_s | Use logical_path to store the sourcemap
As it’s used already in the magic comment | opal_opal | train | rb |
21d65e09b45f0515cde6166345f46c3f506dd08f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ setup(
url='http://github.com/mthornhill/django-postal',
license='BSD',
description="A Django app for l10n of postal addresses.",
- long_description=read('README'),
+ long_description=read('README.rst'),
author='Michael Thornhill',
author_email='[email protected]', | fix up long_description file location | mthornhill_django-postal | train | py |
b7402505aefc89841ee9dda18f8b31c37661dd6b | diff --git a/src/styles/style_manager.js b/src/styles/style_manager.js
index <HASH>..<HASH> 100755
--- a/src/styles/style_manager.js
+++ b/src/styles/style_manager.js
@@ -166,7 +166,7 @@ StyleManager.update = function (name, settings) {
Styles[name].name = name;
Styles[name].initialized = false;
- Styles[name].defines = (base.defines && Object.create(base.defines)) || {};
+ Styles[name].defines = Object.assign({}, base.defines||{}, settings.defines||{});
// Merge shaders: defines, uniforms, blocks
let shaders = {}; | copy base style defines instead of pointing to them through prototype | tangrams_tangram | train | js |
7a6ce3ecbc883d4d6a7aa1821bbc9633751fd67e | diff --git a/gtk/gtk.go b/gtk/gtk.go
index <HASH>..<HASH> 100644
--- a/gtk/gtk.go
+++ b/gtk/gtk.go
@@ -5538,6 +5538,17 @@ func (v *ProgressBar) GetFraction() float64 {
return float64(c)
}
+// SetShowText is a wrapper around gtk_progress_bar_set_show_text().
+func (v *ProgressBar) SetShowText(showText bool) {
+ C.gtk_progress_bar_set_show_text(v.native(), gbool(showText))
+}
+
+// GetShowText is a wrapper around gtk_progress_bar_get_show_text().
+func (v *ProgressBar) GetShowText() bool {
+ c := C.gtk_progress_bar_get_show_text(v.native())
+ return gobool(c)
+}
+
// SetText() is a wrapper around gtk_progress_bar_set_text().
func (v *ProgressBar) SetText(text string) {
cstr := C.CString(text) | Add ProgressBar.Get/SetShowText.
We already had the .SetText method, but without being able to actually
enable showing text, it was rather useless. | gotk3_gotk3 | train | go |
3daeecd3d2a2a6054de7325655599bb32ef8a7ee | diff --git a/lib/classes/oauth2/client.php b/lib/classes/oauth2/client.php
index <HASH>..<HASH> 100644
--- a/lib/classes/oauth2/client.php
+++ b/lib/classes/oauth2/client.php
@@ -487,9 +487,14 @@ class client extends \oauth2_client {
* the fields back into moodle fields.
*
* @return array|false Moodle user fields for the logged in user (or false if request failed)
+ * @throws moodle_exception if the response is empty after decoding it.
*/
public function get_userinfo() {
$url = $this->get_issuer()->get_endpoint_url('userinfo');
+ if (empty($url)) {
+ return false;
+ }
+
$response = $this->get($url);
if (!$response) {
return false;
@@ -501,6 +506,11 @@ class client extends \oauth2_client {
return false;
}
+ if (is_null($userinfo)) {
+ // Throw an exception displaying the original response, because, at this point, $userinfo shouldn't be empty.
+ throw new moodle_exception($response);
+ }
+
return $this->map_userinfo_to_fields($userinfo);
} | MDL-<I> lib: Fix URL blocked error for userinfo endpoint
When the oAuth2 issuer hasn't any userinfo endpoint, a call to
$this->get(false) was done, which was returning "The URL is
blocked".
This is a regression from MDL-<I>, which added some cURL security
checks. | moodle_moodle | train | php |
ac59f5257427970cf4c79b4be7da8b5c52dc815d | diff --git a/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java b/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java
index <HASH>..<HASH> 100644
--- a/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java
+++ b/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java
@@ -696,7 +696,7 @@ public class TaskManager extends CuratorAsyncManager {
public List<SingularityTaskId> getLaunchingTasks() {
return getActiveTaskIds().stream()
- .filter((t) -> !exists(getUpdatePath(t, ExtendedTaskState.TASK_STARTING)))
+ .filter((t) -> exists(getUpdatePath(t, ExtendedTaskState.TASK_STARTING)))
.collect(Collectors.toList());
} | Filter to only starting tasks when reconciling | HubSpot_Singularity | train | java |
0907fd34c4e59eb91e794e399e350c7a3370209b | diff --git a/provision/docker/provisioner.go b/provision/docker/provisioner.go
index <HASH>..<HASH> 100644
--- a/provision/docker/provisioner.go
+++ b/provision/docker/provisioner.go
@@ -158,11 +158,6 @@ func (p *dockerProvisioner) deploy(a provision.App, imageId string, w io.Writer)
} else {
_, err = runReplaceUnitsPipeline(w, a, containers)
}
- if err != nil {
- fmt.Fprint(w, "\n ---> App failed to start, please check its logs for more details...\n\n")
- } else {
- fmt.Fprint(w, "\n ---> App will be restarted, please check its logs for more details...\n\n")
- }
return err
}
@@ -231,7 +226,7 @@ func addContainersWithHost(w io.Writer, a provision.App, units int, destinationH
if units > 1 {
plural = "s"
}
- fmt.Fprintf(&writer, "\n---- Starting %d unit%s ----\n", units, plural)
+ fmt.Fprintf(&writer, "\n---- Starting %d new unit%s ----\n", units, plural)
for i := 0; i < units; i++ {
wg.Add(1)
go func() { | provision/docker: improve output on add units
Now we say that we're removing the old units, then let's say that we're
adding new units before :)
Also, I've removed that clumsy "will be restart" or "failed to restart".
It was just a boilerplate, nobody cares about it anymore. | tsuru_tsuru | train | go |
886f84b2edaff4733469a8f2cd130775b4ab1439 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -171,6 +171,8 @@ const _translators = [
// runtime req only supports module in user space
switchToUserSpace();
(new Function(text))();
+ // could be anonymous
+ userSpace.nameAnonymousModule(parsedId.cleanId);
});
}
];
@@ -219,12 +221,10 @@ function runtimeReq(id) {
throw new Error(`no runtime translator to handle ${parsed.cleanId}`);
})
.then(() => {
- // could be anonymous
- userSpace.nameAnonymousModule(parsed.cleanId);
if (userSpace.has(parsed.cleanId)) {
return userSpace.req(parsed.cleanId);
} else {
- throw new Error(`module "${id}" is missing from url "${JSON.stringify(urlsForId(id))}"`);
+ throw new Error(`module "${parsed.cleanId}" is missing from url "${JSON.stringify(urlsForId(id))}"`);
}
});
} | fix: fix timing issue on anonymous module | dumberjs_dumber-module-loader | train | js |
a6bae33deb081a2ebd1339a1b18d615aeddd295d | diff --git a/src/helpers.php b/src/helpers.php
index <HASH>..<HASH> 100644
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -125,6 +125,28 @@ if (!function_exists('html_params')) {
}
}
+if(!function_exists('chain')){
+ /**
+ * An implementation of Python's itertools.chain method.
+ *
+ * Makes an iterator that returns elements from teh first iterable until
+ * it is exhausted, then proceeds to the next iterable, until all of the
+ * iterables are exhausted. Used for treating consecutive sequences as a
+ * single sequence
+ *
+ * @see https://docs.python.org/2/library/itertools.html#itertools.chain
+ * @param array $iterables An array of iterables to iterate through
+ * @return Generator
+ */
+ function chain(array $iterables){
+ foreach($iterables as $it){
+ foreach($it as $element){
+ yield $element;
+ }
+ }
+ }
+}
+
abstract class CanCall {
public function call(){
throw new RuntimeException; | Implemented a chain function to behave like Python's itertools.chain method | Deathnerd_php-wtforms | train | php |
30348fcb58dcbf742a776ec423ab717736686463 | diff --git a/lib/opal/parser.rb b/lib/opal/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/opal/parser.rb
+++ b/lib/opal/parser.rb
@@ -179,12 +179,12 @@ module Opal
code = @indent + process(s(:scope, sexp), :stmt)
}
- vars << "__opal = Opal"
- vars << "self = __opal.top"
- vars << "__scope = __opal"
- vars << "nil = __opal.nil"
- vars << "def = #{current_self}._klass.prototype" if @scope.defines_defn
- vars.concat @helpers.keys.map { |h| "__#{h} = __opal.#{h}" }
+ @scope.add_temp "__opal = Opal"
+ @scope.add_temp "self = __opal.top"
+ @scope.add_temp "__scope = __opal"
+ @scope.add_temp "nil = __opal.nil"
+ @scope.add_temp "def = #{current_self}._klass.prototype" if @scope.defines_defn
+ @helpers.keys.each { |h| @scope.add_temp "__#{h} = __opal.#{h}" }
code = "#{INDENT}var #{vars.join ', '};\n" + INDENT + @scope.to_vars + "\n" + code
end | Improve formatting of begin/rescue statements | opal_opal | train | rb |
8e73a8062e03a6526f757e7678a9b0bdbf0e268e | diff --git a/spec/bolt_server/file_cache_spec.rb b/spec/bolt_server/file_cache_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bolt_server/file_cache_spec.rb
+++ b/spec/bolt_server/file_cache_spec.rb
@@ -149,7 +149,7 @@ describe BoltServer::FileCache, puppetserver: true do
it 'will create and run the purge timer' do
expect(file_cache.instance_variable_get(:@purge)).to be_a(Concurrent::TimerTask)
expect(file_cache.instance_variable_get(:@cache_dir_mutex)).to eq(other_mutex)
- expect(other_mutex).to receive(:with_write_lock)
+ expect(other_mutex).to receive(:with_write_lock).at_most(2).times
file_cache
sleep 2 # allow time for the purge timer to fire | (maint) Fix bolt_server file_cache spec test
The file cache test sets a purge timeout/interval to 1 second, then sleeps for 2 seconds to allow enough time for the purge timer to fire. In most cases this is enough time for the mocked mutex to recieve `with_write_lock` one time. In some cases the timer fires twice. Given the interval is 1 second and we wait for 2 this is not unreasonable. This commit expects the timer to fire at most 2 times in the 2 seconds. | puppetlabs_bolt | train | rb |
6846801b7f9731a1f8c009859049a345e75792ed | diff --git a/lib/deployml/options/thin.rb b/lib/deployml/options/thin.rb
index <HASH>..<HASH> 100644
--- a/lib/deployml/options/thin.rb
+++ b/lib/deployml/options/thin.rb
@@ -8,7 +8,7 @@ module DeploYML
DEFAULTS = {
:environment => :production,
:address => '127.0.0.1',
- :socket => '/var/run/thin.sock',
+ :socket => '/tmp/thin.sock',
:servers => 2
} | Re-default the Thin --socket option to /tmp/thin.sock.
* Since we definitely don't have write access to /var/run. | postmodern_deployml | train | rb |
5a9a798c706872dc0b4488f46bdd5759b6e7874c | diff --git a/documenteer/sphinxconfig/technoteconf.py b/documenteer/sphinxconfig/technoteconf.py
index <HASH>..<HASH> 100644
--- a/documenteer/sphinxconfig/technoteconf.py
+++ b/documenteer/sphinxconfig/technoteconf.py
@@ -138,7 +138,9 @@ def _build_confs(metadata):
c['todo_include_todos'] = True
# Configuration for Intersphinx
- c['intersphinx_mapping'] = {'https://docs.python.org/': None}
+ c['intersphinx_mapping'] = {}
+ # Add Python 3 intersphinx inventory in projects via
+ # c['intersphinx_mapping']['python'] = ('https://docs.python.org/3', None)
# -- Options for HTML output ---------------------------------------------- | Python not technote intersphinx default
Individual technotes must choose to add a Python object inventory via
intersphinx. This makes technote builds faster when the Python object
inventory is not needed. | lsst-sqre_documenteer | train | py |
01de3f8a10013f0c6a0c2ee4a225bfc690b8ca00 | diff --git a/viewport-units-buggyfill.js b/viewport-units-buggyfill.js
index <HASH>..<HASH> 100755
--- a/viewport-units-buggyfill.js
+++ b/viewport-units-buggyfill.js
@@ -24,7 +24,6 @@
var initialized = false;
var options;
- var refreshDebounce;
var viewportUnitExpression = /([+-]?[0-9.]+)(vh|vw|vmin|vmax)/g;
var calcExpression = /calc\(/g;
var quoteExpression = /[\"\']/g;
@@ -69,6 +68,12 @@
}
function initialize(initOptions) {
+ if (initOptions === true) {
+ initOptions = {
+ force: true
+ };
+ }
+
options = initOptions || {};
if (initialized || (!options.force && !is_safari_or_uiwebview && !is_bad_IE)) {
// this buggyfill only applies to mobile safari
@@ -132,7 +137,6 @@
findProperties();
-
// iOS Safari will report window.innerWidth and .innerHeight as 0
// unless a timeout is used here.
// TODO: figure out WHY innerWidth === 0 | old initialize() expected a boolean | rodneyrehm_viewport-units-buggyfill | train | js |
c1ac11b3213ead9582288ae69992f62b622a4a74 | diff --git a/lib/contacts-fields-update.js b/lib/contacts-fields-update.js
index <HASH>..<HASH> 100644
--- a/lib/contacts-fields-update.js
+++ b/lib/contacts-fields-update.js
@@ -38,15 +38,6 @@ ContactsFieldsUpdate.prototype.name = function(name){
};
/**
- * get/set name
- * @param {String} [type]
- * @return {ContactsFieldsUpdate} or {String}
- */
-ContactsFieldsUpdate.prototype.type = function(type){
- return this.param('type', type);
-};
-
-/**
* execute
* @return {Promise}
*/
diff --git a/test/contacts.js b/test/contacts.js
index <HASH>..<HASH> 100644
--- a/test/contacts.js
+++ b/test/contacts.js
@@ -355,12 +355,10 @@ describe('phonebook v2', function(){
it('should update custom field', function(done){
smsapi.contacts.fields
.update(testField.id)
- .name(testField.name)
- .type('EMAIL')
+ .name(testField.name + 'x')
.execute()
.then(function(result){
- assert.equal(result.name, testField.name);
- assert.equal(result.type, 'EMAIL');
+ assert.equal(result.name, testField.name + 'x');
done();
})
.catch(done); | Can't change type of the custom contact field | smsapi_smsapi-javascript-client | train | js,js |
556a93b9c0dfab6b8dd4bf4d0127d3ed00e33aa4 | diff --git a/remi/gui.py b/remi/gui.py
index <HASH>..<HASH> 100644
--- a/remi/gui.py
+++ b/remi/gui.py
@@ -197,8 +197,8 @@ class Tag(object):
To retrieve the child call get_child or access to the Tag.children[key] dictionary.
Args:
- key (str, Tag): Unique child's identifier
- child (Tag):
+ key (str): Unique child's identifier
+ child (Tag, str):
"""
if hasattr(child, 'attributes'):
child.attributes['parent_widget'] = str(id(self))
@@ -1131,7 +1131,7 @@ class GenericDialog(Widget):
Args:
key (str): The unique identifier for the field.
- field (Widget): The instance of the field Widget. It can be for example a TextInput or maybe a custom widget.
+ field (Widget): The widget to be added to the dialog, TextInput or any Widget for example.
"""
self.inputs[key] = field
container = Widget()
@@ -1387,7 +1387,7 @@ class ListItem(Widget):
def __init__(self, text, **kwargs):
"""
Args:
- text (str): The textual content of the ListItem.
+ text (str, unicode): The textual content of the ListItem.
kwargs: See Widget.__init__()
"""
super(ListItem, self).__init__(**kwargs) | gui: doc tweaks to quiet errors | dddomodossola_remi | train | py |
99958505b3a0c7a9bd4d60ca65d84c06460afc13 | diff --git a/lib/genevalidator/arg_validation.rb b/lib/genevalidator/arg_validation.rb
index <HASH>..<HASH> 100644
--- a/lib/genevalidator/arg_validation.rb
+++ b/lib/genevalidator/arg_validation.rb
@@ -107,7 +107,7 @@ module GeneValidator
assert_blast_installed
assert_blast_compatible
else
- export_bin_dir(blast_bin_dir)
+ export_bin_dir(@opt[:blast_bin])
end
end | fix bug in arg_validation | wurmlab_genevalidator | train | rb |
ee47f7ad0ae91ed649d472fd110a048f85fb8426 | diff --git a/lib/git_curate/runner.rb b/lib/git_curate/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/git_curate/runner.rb
+++ b/lib/git_curate/runner.rb
@@ -26,8 +26,10 @@ module GitCurate
return EXIT_FAILURE
end
- print_help
- puts
+ if interactive?
+ print_help
+ puts
+ end
branches = Branch.local
branches.reject!(&:current?) if interactive? | Only print help if session is interactive | matt-harvey_git_curate | train | rb |
2bbf4bfc2a49ccb05f4036510ddcea0c2a4065d0 | diff --git a/lib/urls.js b/lib/urls.js
index <HASH>..<HASH> 100644
--- a/lib/urls.js
+++ b/lib/urls.js
@@ -42,6 +42,15 @@ exports.buildRequestUrl = function(options) {
else url = "https://svcs.ebay.com/MerchandisingService";
break;
+ // this is not a real service, it's more of a meta-service. the name is made up here.
+ // it's also not really an API - it's used for HTML consent pages -
+ // but other URLs for eBay's systems are here, so including this here too.
+ // @see http://developer.ebay.com/devzone/guides/ebayfeatures/Basics/Tokens-MultipleUsers.html
+ case 'Signin':
+ if (options.sandbox) url = 'https://signin.sandbox.ebay.com/ws/eBayISAPI.dll';
+ else url = 'https://signin.ebay.com/ws/eBayISAPI.dll';
+ break;
+
default:
if (options.sandbox) {
throw new Error("Sandbox endpoint for " + serviceName + " service not yet implemented. Please add."); | add 'Signin' pseudo-service URLs for building auth consent form URLs. | benbuckman_nodejs-ebay-api | train | js |
8e7e95943441bc459156f5c0ae36b6de40517d09 | diff --git a/lib/jsduck/page.rb b/lib/jsduck/page.rb
index <HASH>..<HASH> 100644
--- a/lib/jsduck/page.rb
+++ b/lib/jsduck/page.rb
@@ -53,7 +53,7 @@ module JsDuck
def abstract
[
"<table cellspacing='0'>",
- row("Extends:", @cls.parent ? class_link(@cls.parent.full_name) : "Object"),
+ row("Extends:", extends_link),
classes_row("Mixins:", @cls.mixins),
row("Defind In:", file_link),
classes_row("Subclasses:", @relations.subclasses(@cls)),
@@ -73,6 +73,14 @@ module JsDuck
"<a href='source/#{@cls[:href]}'>#{File.basename(@cls[:filename])}</a>"
end
+ def extends_link
+ if @cls[:extends]
+ @relations[@cls[:extends]] ? class_link(@cls[:extends]) : @cls[:extends]
+ else
+ "Object"
+ end
+ end
+
def classes_row(label, classes)
if classes.length > 0
classes = classes.sort {|a, b| a.short_name <=> b.short_name } | Show parent class name when link can't be created.
Previously "Object" was shown as parent class when the source
for the parent class was missing - obviously wrong. | senchalabs_jsduck | train | rb |
5427435ed4af0d50a4fd58c25ea7052c181f909a | diff --git a/example/index.js b/example/index.js
index <HASH>..<HASH> 100644
--- a/example/index.js
+++ b/example/index.js
@@ -12,3 +12,4 @@ ParentSearch(__dirname + "/path/to/some/directory", "package.json", {
// Search all package.json files starting with this example path
console.log(ParentSearch(__dirname + "/path/to/some/directory", "package.json", { multiple: true }));
+console.log(ParentSearch(__dirname + "/path/to/some/directory", "package.json"));
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -61,7 +61,7 @@ function ParentSearch(path, search, options, callback, progress) {
} else {
result = nextSync(path);
if (options.multiple === false) {
- return result;
+ return buildRes(result);
}
do { | Use the buildRes function to build the response | IonicaBizau_node-parent-search | train | js,js |
88ffc28aec734143fd06ab9b65d0411c62fca832 | diff --git a/src/LinkORB/Buckaroo/SoapClientWSSEC.php b/src/LinkORB/Buckaroo/SoapClientWSSEC.php
index <HASH>..<HASH> 100644
--- a/src/LinkORB/Buckaroo/SoapClientWSSEC.php
+++ b/src/LinkORB/Buckaroo/SoapClientWSSEC.php
@@ -11,7 +11,7 @@ class SoapClientWSSEC extends \SoapClient
// buckaroo requires all numbers to have period notation, otherwise
// an internal error will occur on the server.
$locale = setlocale(LC_NUMERIC, '0');
- setlocale(LC_NUMERIC, 'en_US.UTF-8');
+ setlocale(LC_NUMERIC, array('en_US', 'en_US.UTF-8'));
$ret = parent::__call($name, $args);
setlocale(LC_NUMERIC, $locale);
return $ret; | Sometimes, UTF-8 version does not exist | linkorb_buckaroo | train | php |
9e61ecb64b550fd9f76775df8cf9eb2d5ddae14b | diff --git a/example/stdout.js b/example/stdout.js
index <HASH>..<HASH> 100644
--- a/example/stdout.js
+++ b/example/stdout.js
@@ -1,17 +1,17 @@
var debug = require('../');
-var log = debug('app:log');
+var error = debug('app:error');
-// by default console.log is used
-log('goes to stdout!');
+// by default stderr is used
+error('goes to stderr!');
-var error = debug('app:error');
-// set this namespace to log via console.error
-error.log = console.error.bind(console); // don't forget to bind to console!
-error('goes to stderr');
-log('still goes to stdout!');
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
-// set all output to go via console.warn
+// set all output to go via console.info
// overrides all per-namespace log settings
-debug.log = console.warn.bind(console);
-log('now goes to stderr via console.warn');
-error('still goes to stderr, but via console.warn now');
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now'); | Updated example/stdout.js to match debug current behaviour | visionmedia_debug | train | js |
49a8e15090f288f3048b04267ce4181422923659 | diff --git a/lib/nightwatch-runner.js b/lib/nightwatch-runner.js
index <HASH>..<HASH> 100644
--- a/lib/nightwatch-runner.js
+++ b/lib/nightwatch-runner.js
@@ -27,8 +27,7 @@ function bootstrap (options) {
source: true,
snippets: true,
colors: true,
- // format: ['pretty', 'json:' + tempLogFile.name]
- format: ['pretty']
+ format: ['pretty', 'json:' + tempLogFile.name]
}, configurationArgs)
formatters = configuration.getFormatters()
@@ -99,6 +98,8 @@ function patchNighwatchTestCase () {
return testResults
})
}
+
+ TestCase.prototype.run = origRun
}
function patchNighwatchAsyncTree () { | Try to fix travis tests #2 | mucsi96_nightwatch-cucumber | train | js |
305c5d058d85a0813a10dc2635875617941f80e5 | diff --git a/tests/tests-common/src/main/java/com/hazelcast/simulator/tests/map/MapLongPerformanceTest.java b/tests/tests-common/src/main/java/com/hazelcast/simulator/tests/map/MapLongPerformanceTest.java
index <HASH>..<HASH> 100644
--- a/tests/tests-common/src/main/java/com/hazelcast/simulator/tests/map/MapLongPerformanceTest.java
+++ b/tests/tests-common/src/main/java/com/hazelcast/simulator/tests/map/MapLongPerformanceTest.java
@@ -47,15 +47,15 @@ public class MapLongPerformanceTest extends AbstractTest {
}
@TimeStep(prob = 0.1)
- public void put(BaseThreadContext threadContext) {
- Integer key = threadContext.randomInt(keyCount);
+ public void put(BaseThreadContext context) {
+ int key = context.randomInt(keyCount);
map.set(key, System.currentTimeMillis());
}
@TimeStep(prob = -1)
- public void get(BaseThreadContext threadContext) {
- Integer key = threadContext.randomInt(keyCount);
+ public void get(BaseThreadContext context) {
+ int key = context.randomInt(keyCount);
map.get(key);
} | Cleanup of MapLongPerformanceTest. | hazelcast_hazelcast-simulator | train | java |
55b27cf684d8ab05e7a7168875171524d8bc719a | diff --git a/algoliasearch/account_client.py b/algoliasearch/account_client.py
index <HASH>..<HASH> 100644
--- a/algoliasearch/account_client.py
+++ b/algoliasearch/account_client.py
@@ -37,19 +37,17 @@ class AccountClient(object):
# Copy synonyms
synonyms = source_index.browse_synonyms()
responses.push(
- destination_index.replace_all_synonyms(synonyms, request_options)
+ destination_index.save_synonyms(synonyms, request_options)
)
# Copy rules
rules = source_index.browse_rules()
- responses.push(
- destination_index.replace_all_rules(rules, request_options)
- )
+ responses.push(destination_index.save_rules(rules, request_options))
# Copy objects
objects = source_index.browse_objects()
responses.push(
- destination_index.replace_all_objects(objects)
+ destination_index.save_objects(objects, request_options)
)
return responses | Replaces replace_all by traditional save_ | algolia_algoliasearch-client-python | train | py |
bfcfdf911da5402a32f55ffd6938a3273d06a06a | diff --git a/src/Illuminate/Http/Client/Response.php b/src/Illuminate/Http/Client/Response.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Http/Client/Response.php
+++ b/src/Illuminate/Http/Client/Response.php
@@ -208,6 +208,18 @@ class Response implements ArrayAccess
}
/**
+ * Closes the stream and any underlying resources.
+ *
+ * @return $this
+ */
+ public function close()
+ {
+ $this->response->getBody()->close();
+
+ return $this;
+ }
+
+ /**
* Get the response cookies.
*
* @return \GuzzleHttp\Cookie\CookieJar | Added "close" method to Http response | laravel_framework | train | php |
983b6f5166fbc78c4fc2ba6e8a844aa035aab634 | diff --git a/lib/actv/version.rb b/lib/actv/version.rb
index <HASH>..<HASH> 100644
--- a/lib/actv/version.rb
+++ b/lib/actv/version.rb
@@ -1,3 +1,3 @@
module ACTV
- VERSION = "2.0.0"
+ VERSION = "2.1.0"
end | Bumps version to <I> to support quizzes | activenetwork_actv | train | rb |
fb5f1fe50ec47efeb220b3acf6163e03965821fe | diff --git a/test/schema_test.rb b/test/schema_test.rb
index <HASH>..<HASH> 100644
--- a/test/schema_test.rb
+++ b/test/schema_test.rb
@@ -12,6 +12,8 @@ class SchemaTest < Minitest::Test
assert_works "--from pgsync_test1 --to pgsync_test3 --schema-only --all-schemas"
assert_equal all_tables, tables($conn3)
assert_equal [], $conn3.exec("SELECT * FROM posts").to_a
+ # make sure all_tables itself isn't broken
+ assert all_tables.size >= 10
end
def test_schema_only_table | Make sure all_table doesn't break | ankane_pgsync | train | rb |
a546d2ea8191b2d88a3bdb3c5aa94a9623d9b781 | diff --git a/packages/selenium-ide/src/content/locatorBuilders.js b/packages/selenium-ide/src/content/locatorBuilders.js
index <HASH>..<HASH> 100644
--- a/packages/selenium-ide/src/content/locatorBuilders.js
+++ b/packages/selenium-ide/src/content/locatorBuilders.js
@@ -491,7 +491,7 @@ LocatorBuilders.add('xpath:position', function(e, opt_contextNode) {
})
LocatorBuilders.add('xpath:innerText', function(el) {
- if (el.innerText) {
+ if (el.innerText && el.nodeName !== 'DIV') {
const initialXpath = `//${el.nodeName.toLowerCase()}[contains(.,'${
el.innerText
}')]` | Excluding divs from innerText locatorBuilder strategy | SeleniumHQ_selenium-ide | train | js |
22914d039ee06f2dfe8f0b84fea75d2aa477dbfd | diff --git a/lib/sanscript/detect.rb b/lib/sanscript/detect.rb
index <HASH>..<HASH> 100644
--- a/lib/sanscript/detect.rb
+++ b/lib/sanscript/detect.rb
@@ -51,7 +51,7 @@ module Sanscript
module_function
def detect_script(text)
- text = text.to_str.gsub(/(?<!\\)##.*?(?<!\\)##/, "\\1")
+ text = text.to_str.gsub(/(?<!\\)##.*?(?<!\\)##|(?<!\\)\{#.*?(?<!\\)#\}/, "")
# Brahmic schemes are all within a specific range of code points.
if RE_BRAHMIC_RANGE === text | Allow Dphil-style control blocks in detect. | ubcsanskrit_sanscript.rb | train | rb |
e97c7a12616c00681c80ae50343079aa4fc6e566 | diff --git a/library/CM/Tracking.php b/library/CM/Tracking.php
index <HASH>..<HASH> 100644
--- a/library/CM/Tracking.php
+++ b/library/CM/Tracking.php
@@ -101,7 +101,7 @@ class CM_Tracking extends CM_Tracking_Abstract {
$html .= <<<EOT
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + ’stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
EOT;
@@ -109,5 +109,4 @@ EOT;
return $html;
}
-
} | changed "ga.src" | cargomedia_cm | train | php |
bf7a3be7b50d223d555d426c899e0bfea5fdbcaa | diff --git a/lib/sink/Observer.js b/lib/sink/Observer.js
index <HASH>..<HASH> 100644
--- a/lib/sink/Observer.js
+++ b/lib/sink/Observer.js
@@ -38,4 +38,3 @@ Observer.prototype.error = function(t, e) {
this.active = false;
this._error(e);
};
-
diff --git a/lib/source/fromArray.js b/lib/source/fromArray.js
index <HASH>..<HASH> 100644
--- a/lib/source/fromArray.js
+++ b/lib/source/fromArray.js
@@ -30,9 +30,17 @@ ArrayProducer.prototype.dispose = function() {
};
function runProducer(t, array, sink) {
- for(var i=0, l=array.length; i<l && this.active; ++i) {
+ return produce(this, array, sink, 0);
+}
+
+function produce(task, array, sink, k) {
+ for(var i=k, l=array.length; i<l && task.active; ++i) {
sink.event(0, array[i]);
}
- this.active && sink.end(0);
+ return end();
+
+ function end() {
+ return task.active && sink.end(0);
+ }
} | Optimizations for fromArray in v8 | mostjs_core | train | js,js |
98710308cb6063cc02cbc1ac4ffe9aa7ab590a85 | diff --git a/src/test/java/integration/SelenideMethodsTest.java b/src/test/java/integration/SelenideMethodsTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/integration/SelenideMethodsTest.java
+++ b/src/test/java/integration/SelenideMethodsTest.java
@@ -174,18 +174,14 @@ public class SelenideMethodsTest extends IntegrationTest {
@Test
public void userCanPressTab() {
$("#username-blur-counter").shouldHave(text("___"));
- sleep(1000);
$("#username").sendKeys(" x ");
$("#username").pressTab();
- sleep(1000);
if (!isHtmlUnit()) {
- // fails in HtmlUnit and Chrome for unknown reason
+ // fails in HtmlUnit for unknown reason
$("#password").shouldBe(focused);
$("#username-mirror").shouldHave(text(" x "));
- if (!isChrome()) {
- $("#username-blur-counter").shouldHave(text("blur: 1"));
- }
+ $("#username-blur-counter").shouldHave(text("blur: "));
}
} | sometimes blur event is triggered twice. ignore the counter. | selenide_selenide | train | java |
a68ded889bea4ffef44c9424761de7e2a46dd482 | diff --git a/api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/model/core/events/EventsProperties.java b/api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/model/core/events/EventsProperties.java
index <HASH>..<HASH> 100644
--- a/api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/model/core/events/EventsProperties.java
+++ b/api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/model/core/events/EventsProperties.java
@@ -40,7 +40,7 @@ public class EventsProperties implements Serializable {
* When running in standalone mode, this typically translates to CAS monitoring
* configuration files and reloading context conditionally if there are any changes.
*/
- private boolean trackConfigurationModifications = true;
+ private boolean trackConfigurationModifications;
/**
* Track authentication events inside a database. | Set Event `trackConfigurationModifications` to `false` by default (#<I>) | apereo_cas | train | java |
831fa04a37442583356e027517f03d7b0caf5433 | diff --git a/tests/cases/resource_test.py b/tests/cases/resource_test.py
index <HASH>..<HASH> 100644
--- a/tests/cases/resource_test.py
+++ b/tests/cases/resource_test.py
@@ -235,10 +235,12 @@ class ResourceTestCase(base.TestCase):
for name in zip.namelist():
expected = self.expectedZip[name]
if isinstance(expected, dict):
- expected = json.dumps(expected, default=str)
- if not isinstance(expected, six.binary_type):
- expected = expected.encode('utf8')
- self.assertEqual(expected, zip.read(name))
+ self.assertEqual(json.loads(zip.read(name).decode('utf8')),
+ json.loads(json.dumps(expected, default=str)))
+ else:
+ if not isinstance(expected, six.binary_type):
+ expected = expected.encode('utf8')
+ self.assertEqual(expected, zip.read(name))
# Download the same resources again, this time triggering the large zip
# file creation (artifically forced). We could do this naturally by
# downloading >65536 files, but that would make the test take several | Fix test failure from undefined dict serialization order | girder_girder | train | py |
8c2c44b5c6a0e7024ce3e830c2f7a5154bfbbe8f | diff --git a/src/python/grpcio/grpc/beta/implementations.py b/src/python/grpcio/grpc/beta/implementations.py
index <HASH>..<HASH> 100644
--- a/src/python/grpcio/grpc/beta/implementations.py
+++ b/src/python/grpcio/grpc/beta/implementations.py
@@ -147,7 +147,7 @@ def secure_channel(host, port, client_credentials):
A secure Channel to the remote host through which RPCs may be conducted.
"""
intermediary_low_channel = _intermediary_low.Channel(
- '%s:%d' % (host, port), client_credentials.intermediary_low_credentials)
+ '%s:%d' % (host, port), client_credentials._intermediary_low_credentials)
return Channel(intermediary_low_channel._internal, intermediary_low_channel) # pylint: disable=protected-access | Fix erroneous attribute name.
This defect was introduced in 9e4d<I>ea5e2bb<I>c. I had thought that
this code was exercised in tests but it is bypassed by the use of
grpc_test.beta.test_utilities.not_really_secure_channel. :-( | grpc_grpc | train | py |
abe250bad22b9da1b9609700353f790cbecb7ff2 | diff --git a/lib/message_bus_client_worker.rb b/lib/message_bus_client_worker.rb
index <HASH>..<HASH> 100644
--- a/lib/message_bus_client_worker.rb
+++ b/lib/message_bus_client_worker.rb
@@ -5,6 +5,7 @@ require "light-service"
require "securerandom"
require "sidekiq"
require "sidekiq-unique-jobs"
+require "active_support/core_ext/hash/indifferent_access"
require "message_bus_client_worker/version"
require "message_bus_client_worker/workers/enqueuing_worker"
require "message_bus_client_worker/workers/subscription_worker"
diff --git a/lib/message_bus_client_worker/workers/subscription_worker.rb b/lib/message_bus_client_worker/workers/subscription_worker.rb
index <HASH>..<HASH> 100644
--- a/lib/message_bus_client_worker/workers/subscription_worker.rb
+++ b/lib/message_bus_client_worker/workers/subscription_worker.rb
@@ -5,7 +5,7 @@ module MessageBusClientWorker
sidekiq_options retry: false, lock: :until_executed
def perform(host, subscriptions, long=false)
- Poll.(host, subscriptions, long)
+ Poll.(host, subscriptions.with_indifferent_access, long)
end
end | Use HashWithIndifferentAccess to avoid hash keys converted to string | bloom-solutions_message_bus_client_worker | train | rb,rb |
8e447ac1ca73be8fe61298229e8d84e66eaf7568 | diff --git a/skyfield/nutationlib.py b/skyfield/nutationlib.py
index <HASH>..<HASH> 100644
--- a/skyfield/nutationlib.py
+++ b/skyfield/nutationlib.py
@@ -178,13 +178,15 @@ def equation_of_the_equinoxes_complimentary_terms(jd_tt):
# Evaluate the complementary terms.
- a = ke0_t.dot(fa)
- s0 = se0_t_0.dot(sin(a)) + se0_t_1.dot(cos(a))
-
a = ke1.dot(fa)
- s1 = se1_0 * sin(a) + se1_1 * cos(a)
+ c_terms = se1_0 * sin(a)
+ c_terms += se1_1 * cos(a)
+ c_terms *= t
+
+ a = ke0_t.dot(fa)
+ c_terms += se0_t_0.dot(sin(a))
+ c_terms += se0_t_1.dot(cos(a))
- c_terms = s0 + s1 * t
c_terms *= ASEC2RAD
return c_terms
@@ -334,7 +336,6 @@ fa0, fa1, fa2, fa3, fa4 = array((
)).T[:,:,None]
def fundamental_arguments(t):
-
"""Compute the fundamental arguments (mean elements) of Sun and Moon.
`t` - TDB time in Julian centuries since J2000.0, as float or NumPy array | Cleanup to reduce array creations in nutation | skyfielders_python-skyfield | train | py |
29f038dbad92b3a2af04a49b5aa456d1c54462dd | diff --git a/galpy/potential_src/SnapshotPotential.py b/galpy/potential_src/SnapshotPotential.py
index <HASH>..<HASH> 100644
--- a/galpy/potential_src/SnapshotPotential.py
+++ b/galpy/potential_src/SnapshotPotential.py
@@ -1,3 +1,8 @@
+try:
+ from pynbody import grav_omp
+except ImportError:
+ raise ImportError("This class is designed to work with pynbody snapshots -- obtain from pynbody.github.io")
+
from pynbody import grav_omp
import numpy as np
from galpy.potential import Potential | added check for pynbody | jobovy_galpy | train | py |
3fd08c3b7e9e5744cd44f9ad2c4c9c0e6e3da3ef | diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php
index <HASH>..<HASH> 100755
--- a/src/Commands/InstallCommand.php
+++ b/src/Commands/InstallCommand.php
@@ -89,7 +89,7 @@ class InstallCommand extends Command
$this->info('Updating Root package.json to include dependencies');
$process = new Process('
- npm i foundation-sites scrollreveal"^3.4.0" motion-ui jquery --save-dev &&
+ npm i foundation-sites scrollreveal@"^3.4.0" motion-ui jquery --save-dev &&
npm uninstall bootstrap bootstrap-sass --save-dev &&
npm run dev
'); | Fixed issue with installation scrollreveal tag | pvtl_voyager-frontend | train | php |
9cfb037be63f25f18218d1dcc0e471745ca9f28e | diff --git a/pkg/deploy/util/util.go b/pkg/deploy/util/util.go
index <HASH>..<HASH> 100644
--- a/pkg/deploy/util/util.go
+++ b/pkg/deploy/util/util.go
@@ -345,6 +345,13 @@ func MakeDeploymentV1(config *deployapi.DeploymentConfig, codec runtime.Codec) (
return nil, fmt.Errorf("couldn't clone podSpec: %v", err)
}
+ // Fix trailing and leading whitespace in the image field
+ // This is needed to sanitize old deployment configs where spaces were permitted but
+ // kubernetes 3.7 (#47491) tightened the validation of container image fields.
+ for i := range podSpec.Containers {
+ podSpec.Containers[i].Image = strings.TrimSpace(podSpec.Containers[i].Image)
+ }
+
controllerLabels := make(labels.Set)
for k, v := range config.Labels {
controllerLabels[k] = v | deploy: remove leading and trailing spaces from images | openshift_origin | train | go |
238ede452883428ade0b6b7524ed8f43f946676d | diff --git a/spec/lib/feed_autodiscoverer_spec.rb b/spec/lib/feed_autodiscoverer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/feed_autodiscoverer_spec.rb
+++ b/spec/lib/feed_autodiscoverer_spec.rb
@@ -45,21 +45,11 @@ describe Feed2Email::FeedAutodiscoverer do
}
]
}
+
let(:feed_uri) { 'https://www.ruby-lang.org/en/feeds/news.rss' }
it { is_expected.to eq feeds }
- context 'called before' do
- before { subject }
-
- it { is_expected.to eq feeds }
-
- it 'caches discovered feeds' do
- expect(Nokogiri).not_to receive(:HTML)
- subject
- end
- end
-
context 'not discoverable' do
let(:content_type) { 'text/plain' } | Remove invalid example for discovered feeds caching
It was actually checking whether FeedAutodiscoverer#html_head was cached
and, since it is, it was always passing. | agorf_feed2email | train | rb |
28ec73dc5b87d93ff6de7c8b490ae5274f6ea390 | diff --git a/lib/setuplib.php b/lib/setuplib.php
index <HASH>..<HASH> 100644
--- a/lib/setuplib.php
+++ b/lib/setuplib.php
@@ -750,6 +750,9 @@ function setup_get_remote_url() {
} else if (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
//nginx - not officially supported
+ if (!isset($_SERVER['SCRIPT_NAME'])) {
+ die('Invalid server configuration detected, please try to add "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" to the nginx server configuration.');
+ }
$rurl['scheme'] = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded | MDL-<I> add detection of misconfigured nginx server | moodle_moodle | train | php |
20edfdab8d5230bccae03fc4f3fe0eab5c79c69e | diff --git a/bika/lims/content/analysis.py b/bika/lims/content/analysis.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/analysis.py
+++ b/bika/lims/content/analysis.py
@@ -358,20 +358,6 @@ class Analysis(BaseContent):
self.setResult(result)
return True
- # def getInterimFields(self):
-
- service = self.getService()
- service_interims = service.getInterimFields()
- calculation = service.getCalculation()
- calc_interims = ca.getInterimFields()
-
-
-
- InterimFields = self.Schema().getField('InterimFields').get(self)
-
-
-
-
def get_default_specification(self):
bsc = getToolByName(self, "bika_setup_catalog") | Fix retraction failure when "-" are present in service | senaite_senaite.core | train | py |
10bd2dfbde5840817a63c07900b2ce397138409b | diff --git a/tests/test.changes.js b/tests/test.changes.js
index <HASH>..<HASH> 100644
--- a/tests/test.changes.js
+++ b/tests/test.changes.js
@@ -42,6 +42,26 @@ adapters.map(function(adapter) {
});
});
+ asyncTest("Changes Since", function () {
+ var docs = [
+ {_id: "0", integer: 0},
+ {_id: "1", integer: 1},
+ {_id: "2", integer: 2},
+ {_id: "3", integer: 3}
+ ];
+ initTestDB(this.name, function(err, db) {
+ db.bulkDocs({docs: docs}, function(err, info) {
+ db.changes({
+ since: 2,
+ complete: function(err, results) {
+ equal(results.results.length, 2, 'Partial results');
+ start();
+ }
+ });
+ });
+ });
+ });
+
asyncTest("Changes doc", function () {
initTestDB(this.name, function(err, db) {
db.post({test:"somestuff"}, function (err, info) { | Add a simple test for changes since | pouchdb_pouchdb | train | js |
ddeeaa60fc090eb26fd01ffd37a5d4884218f399 | diff --git a/knwl.js b/knwl.js
index <HASH>..<HASH> 100644
--- a/knwl.js
+++ b/knwl.js
@@ -258,7 +258,7 @@ function Knwl() {
if (testTime.length === 2) {
if (!isNaN(testTime[0]) && !isNaN(testTime[1])) {
if (testTime[0] > 0 && testTime[0] < 13) {
- if (testTime[1] > 0 && testTime[1] < 61) {
+ if (testTime[1] >= 0 && testTime[1] < 61) {
if (words[i + 1] === "pm") {
time = [testTime[0],testTime[1], "PM",that.preview(i,words)];
times.push(time); | Recognize times that end in :<I>
Fixes #3 | benhmoore_Knwl.js | train | js |
afd344e1108d48ea1e19b148b7dfc4125dc13043 | diff --git a/sitetree/management/commands/sitetreedump.py b/sitetree/management/commands/sitetreedump.py
index <HASH>..<HASH> 100644
--- a/sitetree/management/commands/sitetreedump.py
+++ b/sitetree/management/commands/sitetreedump.py
@@ -3,7 +3,7 @@ from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from sitetree.utils import get_tree_model, get_tree_item_model
-from sitetree.compat import CommandOption, options_getter
+from sitetree.compat import CommandOption, options_getter, VERSION
MODEL_TREE_CLASS = get_tree_model()
@@ -30,7 +30,11 @@ class Command(BaseCommand):
args = '[tree_alias tree_alias ...]'
def add_arguments(self, parser):
- parser.add_argument('args', metavar='tree', nargs='?', help='Tree aliases.', default=[])
+
+ if VERSION >= (1, 11):
+ # Before that args already set with nargs='*'.
+ parser.add_argument('args', metavar='tree', nargs='?', help='Tree aliases.', default=[])
+
get_options(parser.add_argument)
def handle(self, *aliases, **options): | sitetree_dump for pre <I> | idlesign_django-sitetree | train | py |
356b0cb316d4e9742fba02118623b984627a7f9b | diff --git a/templates/js/atk4_univ.js b/templates/js/atk4_univ.js
index <HASH>..<HASH> 100644
--- a/templates/js/atk4_univ.js
+++ b/templates/js/atk4_univ.js
@@ -245,6 +245,9 @@ dialogPrepare: function(options){
var dialog=$('<div class="dialog dialog_autosize" title="Untitled">Loading<div></div></div>').appendTo('body');
if(options.noAutoSizeHack)dialog.removeClass('dialog_autosize');
dialog.dialog(options);
+ if(options.customClass){
+ dialog.parent().addClass(options.customClass);
+ }
$.data(dialog.get(0),'opener',this.jquery);
$.data(dialog.get(0),'options',options); | add ability to add custom class on frames | atk4_atk4 | train | js |
f592f95a68f5923f1acacbc8ef43fa09ae29c71e | diff --git a/lib/6to5/generation/buffer.js b/lib/6to5/generation/buffer.js
index <HASH>..<HASH> 100644
--- a/lib/6to5/generation/buffer.js
+++ b/lib/6to5/generation/buffer.js
@@ -68,7 +68,6 @@ Buffer.prototype.removeLast = function (cha) {
Buffer.prototype.newline = function (i, removeLast) {
if (!this.buf) return;
if (this.format.compact) return;
- if (this.endsWith("{\n")) return;
if (_.isBoolean(i)) {
removeLast = i;
@@ -76,6 +75,7 @@ Buffer.prototype.newline = function (i, removeLast) {
}
if (_.isNumber(i)) {
+ if (this.endsWith("{\n")) i--;
if (this.endsWith(util.repeat(i, "\n"))) return;
var self = this; | Subtract one if line already ends with "{\n" | babel_babel | train | js |
1e5ebac78ed1d3423a600422796a25139e4e2cb2 | diff --git a/lib/veritas/optimizer/algebra/summarization.rb b/lib/veritas/optimizer/algebra/summarization.rb
index <HASH>..<HASH> 100644
--- a/lib/veritas/optimizer/algebra/summarization.rb
+++ b/lib/veritas/optimizer/algebra/summarization.rb
@@ -1,12 +1,27 @@
module Veritas
class Optimizer
module Algebra
+
+ # Abstract base class representing Summarization optimizations
class Summarization < Relation::Operation::Unary
+
+ # Optimize when operand is optimizable
class UnoptimizedOperand < self
+
+ # Test if the operand is unoptimized
+ #
+ # @return [Boolean]
+ #
+ # @api private
def optimizable?
!operand.equal?(operation.operand)
end
+ # Return a Summarization with an optimized operand
+ #
+ # @return [Rename]
+ #
+ # @api private
def optimize
operation = self.operation
operation.class.new(operand, operation.summarize_by, operation.summarizers) | Added YARD docs for Optimizer::Algebra::Summarization | dkubb_axiom | train | rb |
ee40cc9a6d80ce43164f68d6dc3c0446810d836c | diff --git a/saltcloud/clouds/saltify.py b/saltcloud/clouds/saltify.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/saltify.py
+++ b/saltcloud/clouds/saltify.py
@@ -130,9 +130,11 @@ def create(vm_):
'sudo': config.get_config_value(
'sudo', vm_, __opts__, default=(ssh_username != 'root')
),
- 'password': config.get_config_value('password', vm_, __opts__),
+ 'password': config.get_config_value(
+ 'password', vm_, __opts__, search_global=False
+ ),
'ssh_keyfile': config.get_config_value(
- 'ssh_keyfile', vm_, __opts__
+ 'ssh_keyfile', vm_, __opts__, search_global=False
),
'script_args': config.get_config_value(
'script_args', vm_, __opts__ | Some options should not be searched for in the salt-cloud global config. | saltstack_salt | train | py |
ccad86a62538cf7990ea01eaaa5d13828479f339 | diff --git a/decktape.js b/decktape.js
index <HASH>..<HASH> 100755
--- a/decktape.js
+++ b/decktape.js
@@ -231,7 +231,7 @@ process.on('unhandledRejection', error => {
.then(_ => configurePage(plugin, page))
.then(_ => exportSlides(plugin, page, pdf))
.then(async context => {
- fs.writeFileSync(options.filename, await pdf.save({ addDefaultPage: false }));
+ await writePdf(options.filename, pdf);
console.log(chalk`{green \nPrinted {bold ${context.exportedSlides}} slides}`);
browser.close();
process.exit();
@@ -244,6 +244,16 @@ process.on('unhandledRejection', error => {
})();
+async function writePdf(filename, pdf) {
+ const pdfDir = path.dirname(filename);
+ try {
+ fs.accessSync(pdfDir, fs.constants.F_OK);
+ } catch {
+ fs.mkdirSync(pdfDir);
+ }
+ fs.writeFileSync(filename, await pdf.save({ addDefaultPage: false }));
+}
+
function loadAvailablePlugins(pluginsPath) {
return fs.readdirSync(pluginsPath).reduce((plugins, pluginPath) => {
const [, plugin] = pluginPath.match(/^(.*)\.js$/); | Create PDF dir if it doesn't exist | astefanutti_decktape | train | js |
995dc496d4887508362c32b0ccd2484acfe3684b | diff --git a/src/components/toast/toast.js b/src/components/toast/toast.js
index <HASH>..<HASH> 100644
--- a/src/components/toast/toast.js
+++ b/src/components/toast/toast.js
@@ -354,8 +354,9 @@ function MdToastProvider($$interimElementProvider) {
}
}
-
- return templateRoot.outerHTML;
+ // We have to return the innerHTMl, because we do not want to have the `md-template` element to be
+ // the root element of our interimElement.
+ return templateRoot.innerHTML;
}
return template || ''; | fix(toast): apply theming correctly to custom toasts
* Custom configurations for `md-toast` didn't receive any theming, because the interimElement service was applying the theming on the the `md-template` element, which was accidentally used as our template root element.
Fixes #<I>.
Closes #<I> | angular_material | train | js |
7e904f1bafec90584969a860a98ff8f28ab31189 | diff --git a/pyisbn/__init__.py b/pyisbn/__init__.py
index <HASH>..<HASH> 100644
--- a/pyisbn/__init__.py
+++ b/pyisbn/__init__.py
@@ -302,6 +302,7 @@ class Isbn13(Isbn):
:param code: Ignored, only for compatibility with ``Isbn``
:rtype: ``str``
:return: ISBN-10 string
+ :raise ValueError: When ISBN-13 isn't a Bookland "978" ISBN
"""
return convert(self.isbn) | [QA] Added missing :raise: directive to Isbn<I>.convert(). | JNRowe_pyisbn | train | py |
85070b5e5679221be0f44ce1886be99432d53dd0 | diff --git a/activesupport/lib/active_support/core_ext/date/behavior.rb b/activesupport/lib/active_support/core_ext/date/behavior.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/core_ext/date/behavior.rb
+++ b/activesupport/lib/active_support/core_ext/date/behavior.rb
@@ -21,15 +21,19 @@ module ActiveSupport #:nodoc:
#
# Ruby 1.9 uses a preinitialized instance variable so it's unaffected.
# This hack is as close as we can get to feature detection:
- if (Date.today.freeze.inspect rescue false)
- def freeze #:nodoc:
- self.class.private_instance_methods(false).each do |m|
- if m.to_s =~ /\A__\d+__\Z/
- instance_variable_set(:"@#{m}", [send(m)])
+ begin
+ ::Date.today.freeze.jd
+ rescue => frozen_object_error
+ if frozen_object_error.message =~ /frozen/
+ def freeze #:nodoc:
+ self.class.private_instance_methods(false).each do |m|
+ if m.to_s =~ /\A__\d+__\Z/
+ instance_variable_set(:"@#{m}", [send(m)])
+ end
end
- end
- super
+ super
+ end
end
end
end | Date#freeze bug doesn't affect Ruby <I> | rails_rails | train | rb |
d3e6a464d6afe841c7e9387c94a2ed1596032cc4 | diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Factory.php
+++ b/src/Composer/Factory.php
@@ -64,7 +64,7 @@ class Factory
}
$home = $xdgConfig . '/composer';
} else {
- $home = $userDir . '/composer';
+ $home = $userDir . '/.composer';
}
}
} | Fix home directory when system does not support XDG | composer_composer | train | php |
753d4a28d44fb848e71b15b93c90c418c08c28b1 | diff --git a/dataset/table.py b/dataset/table.py
index <HASH>..<HASH> 100644
--- a/dataset/table.py
+++ b/dataset/table.py
@@ -241,7 +241,8 @@ class Table(object):
autoincrement=increment)
self._table.append_column(column)
for column in columns:
- self._table.append_column(column)
+ if not column.name == self._primary_id:
+ self._table.append_column(column)
self._table.create(self.db.executable, checkfirst=True)
elif len(columns):
with self.db.lock: | Check if primary column on first _sync_table call
Checks if column is primary key column on table creation, before
attempting to add again as non-primary key column. | pudo_dataset | train | py |
b6e077a70fa16fe7f3fbb135f7582da142a73720 | diff --git a/test/lib/driver.js b/test/lib/driver.js
index <HASH>..<HASH> 100644
--- a/test/lib/driver.js
+++ b/test/lib/driver.js
@@ -15,6 +15,7 @@ var service;
if(process.env.TRAVIS){
console.log("Hello Travis!");
service = new ChromeDriverService.Builder()
+ .usingAnyFreePort()
.usingDriverExecutable(new File(findsChromeDriver.find()))
.withEnvironment({"DISPLAY":":99.0"})
.build(); | attempting to see if chrome can't bind to a port for travis | jsdevel_webdriver-sync | train | js |
6d2ed6fc9cb34d48f546c336e8afe64c8aa4cc93 | diff --git a/Resources/public/js/resource/manager/views/actions.js b/Resources/public/js/resource/manager/views/actions.js
index <HASH>..<HASH> 100644
--- a/Resources/public/js/resource/manager/views/actions.js
+++ b/Resources/public/js/resource/manager/views/actions.js
@@ -116,6 +116,11 @@
sourceDirectoryId: this.checkedNodes.directoryId,
view: this.parameters.viewName
});
+
+ if(this.isCutMode) {
+ // disable cut/copy/paste/delete/download buttons && empty this.checkedNodes.nodes after paste action
+ this.setInitialState();
+ }
}
},
'toggleFilters': function () { | [CoreBundle] Update actions.js
Updated paste resource action.
After pasting a cuted resource, this.checkedNodes.nodes is empty and all action buttons are disabled to avoid multiple paste of a cuted resource (this was causing an error) | claroline_Distribution | train | js |
6f68682d34c744f8155af4c385d3738b47b1c84b | diff --git a/emirdrp/recipes/aiv/tests/test_common.py b/emirdrp/recipes/aiv/tests/test_common.py
index <HASH>..<HASH> 100644
--- a/emirdrp/recipes/aiv/tests/test_common.py
+++ b/emirdrp/recipes/aiv/tests/test_common.py
@@ -38,3 +38,15 @@ def test_normalize_raw():
assert b.min() >=0
assert b.max() <=1
+def test_normalize_raw_2():
+ tt = numpy.array([-1.0, 655.350, 6553.50, 1e5])
+ rtt = numpy.array([0.0, 0.01, 0.1, 1.0])
+
+ ntt = normalize_raw(tt)
+
+ # In this case, min is 0 and max is 1
+ assert ntt.min() == 0.0
+ assert ntt.max() == 1.0
+
+ assert_allclose(ntt, rtt)
+ | Add new test for normalize_raw | guaix-ucm_pyemir | train | py |
dda703021b57b6837f99425873377d833652d327 | diff --git a/iotilecore/iotile/core/hw/virtual/common_types.py b/iotilecore/iotile/core/hw/virtual/common_types.py
index <HASH>..<HASH> 100644
--- a/iotilecore/iotile/core/hw/virtual/common_types.py
+++ b/iotilecore/iotile/core/hw/virtual/common_types.py
@@ -101,6 +101,8 @@ def pack_rpc_response(response=None, exception=None):
status |= (1 << 7)
elif isinstance(exception, (RPCInvalidIDError, RPCNotFoundError)):
status = 2
+ elif isinstance(exception, BusyRPCResponse):
+ status = 0
elif isinstance(exception, TileNotFoundError):
status = 0xFF
elif isinstance(exception, RPCErrorCode): | Rebase on master and incorporate RPC busy response | iotile_coretools | train | py |
40790e1f6aea2724d1e69082b497da48da3904a1 | diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go
index <HASH>..<HASH> 100644
--- a/cmd/lncli/commands.go
+++ b/cmd/lncli/commands.go
@@ -1133,7 +1133,7 @@ var abandonChannelCommand = cli.Command{
channels due to bugs fixed in newer versions of lnd.
Only available when lnd is built in debug mode. The flag
- --i_know_what_im_doing can be set to override the debug/dev mode
+ --i_know_what_i_am_doing can be set to override the debug/dev mode
requirement.
To view which funding_txids/output_indexes can be used for this command, | Fix typo in abandonchannel description
i_know_what_im_doing --> i_know_what_i_am_doing | lightningnetwork_lnd | train | go |
9e7a73310b206d89b9096331bcf419a733dde018 | diff --git a/pandas/tests/frame/indexing/test_indexing.py b/pandas/tests/frame/indexing/test_indexing.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/frame/indexing/test_indexing.py
+++ b/pandas/tests/frame/indexing/test_indexing.py
@@ -2624,6 +2624,17 @@ class TestDataFrameIndexing:
result = df.loc[IndexType("foo", "bar")]["A"]
assert result == 1
+ @pytest.mark.parametrize("tpl", [tuple([1]), tuple([1, 2])])
+ def test_index_single_double_tuples(self, tpl):
+ # GH 20991
+ idx = pd.Index([tuple([1]), tuple([1, 2])], name="A", tupleize_cols=False)
+ df = DataFrame(index=idx)
+
+ result = df.loc[[tpl]]
+ idx = pd.Index([tpl], name="A", tupleize_cols=False)
+ expected = DataFrame(index=idx)
+ tm.assert_frame_equal(result, expected)
+
def test_boolean_indexing(self):
idx = list(range(3))
cols = ["A", "B", "C"] | TST: add test for indexing with single/double tuples (#<I>) | pandas-dev_pandas | train | py |
2a674fc461b0d2a80a9af6948129dcf41d2644e4 | diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
@@ -338,6 +338,10 @@ class HtmlHelperTest extends CakeTestCase {
$expected = array('a' => array('href' => 'http://www.example.org?param1=value1&param2=value2'), 'http://www.example.org?param1=value1&param2=value2', '/a');
$this->assertTags($result, $expected);
+ $result = $this->Html->link('alert', 'javascript:alert(\'cakephp\');');
+ $expected = array('a' => array('href' => 'javascript:alert('cakephp');'), 'alert', '/a');
+ $this->assertTags($result, $expected);
+
$result = $this->Html->link('write me', 'mailto:[email protected]');
$expected = array('a' => array('href' => 'mailto:[email protected]'), 'write me', '/a');
$this->assertTags($result, $expected); | adding a test for the yet untested javascript protocol | cakephp_cakephp | train | php |
51deb6e00c99ba83b5c4cc400844170ee205976c | diff --git a/lib/minidown/utils.rb b/lib/minidown/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/minidown/utils.rb
+++ b/lib/minidown/utils.rb
@@ -8,7 +8,7 @@ module Minidown
start_with_quote: /\A\>\s*(.+)/,
unorder_list: /\A(\s*)[*\-+]\s+(.+)/,
order_list: /\A(\s*)\d+\.\s+(.+)/,
- code_block: /\A\s*(?:`{3}|~{3,})\s*(\S*)/,
+ code_block: /\A\s*[`~]{3,}\s*(\S*)/,
dividing_line: /\A(\s*[*-]\s*){3,}\z/,
indent_code: /\A\s{4}(.+)/
} | Allow arbitrary number of backticks for fenced code blocks | jjyr_minidown | train | rb |
0b659d513e73f757f150cdf863dfebcedb634111 | diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -3786,6 +3786,17 @@ class FormHelperTest extends CakeTestCase {
'/select'
);
$this->assertTags($result, $expected);
+
+ $this->Form->request->data['Model']['field'] = 50;
+ $result = $this->Form->select('Model.field', array('50f5c0cf' => 'Stringy', '50' => 'fifty'));
+ $expected = array(
+ 'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
+ array('option' => array('value' => '')), '/option',
+ array('option' => array('value' => '50f5c0cf')), 'Stringy', '/option',
+ array('option' => array('value' => '50', 'selected' => 'selected')), 'fifty', '/option',
+ '/select'
+ );
+ $this->assertTags($result, $expected);
}
/** | Add tests for #<I>
Fix included in GH-<I>
Closes #<I> | cakephp_cakephp | train | php |
Subsets and Splits