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
|
---|---|---|---|---|---|
ecfc54a2aff8e96cfbd5f292676350ee5eff3cd1 | diff --git a/user/config-sample.php b/user/config-sample.php
index <HASH>..<HASH> 100644
--- a/user/config-sample.php
+++ b/user/config-sample.php
@@ -68,9 +68,10 @@ $yourls_user_passwords = [
// You can have one or more 'login'=>'password' lines
];
-/** URL shortening method: 36 or 62
+/** URL shortening method: either 36 or 62
** 36: generates all lowercase keywords (ie: 13jkm)
- ** 62: generates mixed case keywords (ie: 13jKm or 13JKm) */
+ ** 62: generates mixed case keywords (ie: 13jKm or 13JKm)
+ ** For more information, see https://yourls.org/urlconvert */
define( 'YOURLS_URL_CONVERT', 36 );
/** Debug mode to output some internal information | Clarify what setting is for
Wiki page added: <URL> | YOURLS_YOURLS | train | php |
17ba7371853a8e73e48c8500afe748a0800a2858 | diff --git a/spyder/widgets/tests/test_editor.py b/spyder/widgets/tests/test_editor.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/tests/test_editor.py
+++ b/spyder/widgets/tests/test_editor.py
@@ -517,7 +517,7 @@ def test_tab_copies_find_to_replace(editor_find_replace_bot):
finder.search_text.set_current_text('This is some test text!')
qtbot.keyPress(finder.search_text, Qt.Key_Tab)
qtbot.wait(100)
- assert finder.replace_text.currentText == 'This is some test text!'
+ assert finder.replace_text.currentText() == 'This is some test text!'
if __name__ == "__main__": | Fix method call
combox box currentText is a method, not a property. | spyder-ide_spyder | train | py |
7983925e1dac4481008c6c7a913f5c4a7524ee37 | diff --git a/src/Robo/Commands/Validate/PhpcsCommand.php b/src/Robo/Commands/Validate/PhpcsCommand.php
index <HASH>..<HASH> 100644
--- a/src/Robo/Commands/Validate/PhpcsCommand.php
+++ b/src/Robo/Commands/Validate/PhpcsCommand.php
@@ -25,6 +25,7 @@ class PhpcsCommand extends BltTasks {
->run();
$exit_code = $result->getExitCode();
if ($exit_code) {
+ $this->logger->notice('Try running `blt fix:phpcbf` to automatically fix standards violations.');
throw new BltException("PHPCS failed.");
}
} | Adding notification after phphcs failure. | acquia_blt | train | php |
867de2a614caef5e86582c49177aed1c724cc3a7 | diff --git a/acestream/request.py b/acestream/request.py
index <HASH>..<HASH> 100644
--- a/acestream/request.py
+++ b/acestream/request.py
@@ -92,7 +92,7 @@ class Request(object):
def _parse_json(self, string):
try:
- return json.loads(str(string))
+ return json.loads(string)
except (IOError, ValueError):
return {} | request: fix json parsing | jonian_python-acestream | train | py |
beb9965c148678656a9137420236d03c51eb40b6 | diff --git a/wepay.php b/wepay.php
index <HASH>..<HASH> 100644
--- a/wepay.php
+++ b/wepay.php
@@ -230,7 +230,7 @@ class WePay {
$headers[] = "Api-Version: " . self::$api_version;
}
- curl_setopt(self::$ch, CURLOPT_USERAGENT, 'WePay v2 PHP SDK v' . self::VERSION);
+ curl_setopt(self::$ch, CURLOPT_USERAGENT, 'WePay v2 PHP SDK v' . self::VERSION . ' Client id:' . self::$client_id);
curl_setopt(self::$ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt(self::$ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt(self::$ch, CURLOPT_TIMEOUT, 30); // 30-second timeout, adjust to taste
@@ -251,6 +251,7 @@ class WePay {
}
throw new Exception('cURL error while making API call to WePay: ' . curl_error(self::$ch), $errno);
}
+
$result = json_decode($raw);
$httpCode = curl_getinfo(self::$ch, CURLINFO_HTTP_CODE);
if ($httpCode >= 400) { | add client_id to user agent for debugging purpose | wepay_PHP-SDK | train | php |
23f407bd0711ab940181b2c31e5c84e0e5b93fd1 | diff --git a/client/index.js b/client/index.js
index <HASH>..<HASH> 100644
--- a/client/index.js
+++ b/client/index.js
@@ -5,14 +5,9 @@ var events = require('events'),
util = require('util'),
utils = require('../lib/utils');
-var transports = {};
-
-fs.readdirSync(path.join(__dirname, 'transports')).forEach(function(fn) {
- var name = fn.replace(/\.js$/, '');
- if (fn != name) {
- transports[name] = require('./transports/' + name);
- }
-});
+var transports = {
+ socket : require('./transports/socket')
+};
function LockdClient(options) {
if (!(this instanceof LockdClient)) { | Don't be overly clever when loading client transports
There won't be many of these, and they won't change very often. | nylen_lockd | train | js |
f4ebdb71313bba3281d6f26ec184dd2d3a6be688 | diff --git a/sprout/rakefile.rb b/sprout/rakefile.rb
index <HASH>..<HASH> 100644
--- a/sprout/rakefile.rb
+++ b/sprout/rakefile.rb
@@ -55,7 +55,7 @@ def apply_shared_spec(s)
s.add_dependency('rubyzip', '>= 0.9.1')
s.add_dependency('archive-tar-minitar', '>= 0.5.1')
- s.add_dependency('rubigen', '= 1.3.3')
+ s.add_dependency('rubigen', '= 1.5.2')
s.add_dependency('net-sftp')
s.add_dependency('net-ssh')
s.add_dependency('rake') | Updated rubigen version dependency to <I> - thanks to cjheath | lukebayes_project-sprouts | train | rb |
02b7e1b56535d99364d2f47e142e1345e738ea60 | diff --git a/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java b/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java
+++ b/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java
@@ -337,6 +337,11 @@ public class OssIndexAnalyzer extends AbstractAnalyzer {
// generate a reference to the vulnerability details on OSS Index
result.addReference(REFERENCE_TYPE, source.getTitle(), source.getReference().toString());
+ // generate references to other references reported by OSS Index
+ for (final String externalReference : source.getExternalReferences()) {
+ result.addReference("MISC", null, externalReference);
+ }
+
// attach vulnerable software details as best we can
final PackageUrl purl = report.getCoordinates();
try { | Extract external references from OSS Index API response | jeremylong_DependencyCheck | train | java |
de6e962adf9f3880fc5c4ebb8379c7af9c86aed4 | diff --git a/src/filesystem/FileSystem.js b/src/filesystem/FileSystem.js
index <HASH>..<HASH> 100644
--- a/src/filesystem/FileSystem.js
+++ b/src/filesystem/FileSystem.js
@@ -840,7 +840,13 @@ define(function (require, exports, module) {
FileSystem.prototype._unwatchAll = function () {
console.warn("File watchers went offline!");
- Object.keys(this._watchedRoots).forEach(this.unwatch, this);
+ Object.keys(this._watchedRoots).forEach(function (path) {
+ var entry = this._index.getEntry(path);
+
+ if (entry) {
+ this.unwatch(entry);
+ }
+ }, this);
// Fire a wholesale change event because all previously watched entries
// have been removed from the index and should no longer be referenced | Type error in _unwatchAll: unwatch takes a FileSystemEntry, not a path | adobe_brackets | train | js |
d7e635030ef887a5bb0d46911697c189f8c952ca | diff --git a/openquake/calculators/event_based.py b/openquake/calculators/event_based.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/event_based.py
+++ b/openquake/calculators/event_based.py
@@ -45,7 +45,8 @@ RUPTURES_PER_BLOCK = 200 # decided by MS
def weight(src):
# heuristic weight
- return len(src.eb_ruptures) * src.ndists
+ # return len(src.eb_ruptures) * src.ndists
+ return sum(ebr.multiplicity for ebr in src.eb_ruptures) * src.ndists
def get_events(ebruptures): | Tried another weight [skip CI]
Former-commit-id: <I>a<I>f<I>acb<I>dbffa<I>dcb<I>b5a7c<I>a3 | gem_oq-engine | train | py |
10c0135222f37be42e3b3facb392984723b27f71 | diff --git a/lib/blueprint.js b/lib/blueprint.js
index <HASH>..<HASH> 100644
--- a/lib/blueprint.js
+++ b/lib/blueprint.js
@@ -8,6 +8,7 @@
// Scoped in API under /v1/{objectName} standard namespaces.
exports.apiObjects = [
'activities',
+ 'activityFields',
'activityTypes',
'authorizations',
'companyFeatures', | adding activityFields api object to blueprint | pipedrive_client-nodejs | train | js |
b0c75223579c768927f33f2b89d2aca11d750388 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,7 @@ from setuptools import setup, find_packages
import tomodachi.__version__
install_requires = [
+ 'pycparser=>2.18',
'aioamqp>=0.10.0, <0.11.0',
'ujson>=1.35',
'uvloop>=0.8.1', | Added pycparser to setup.py | kalaspuff_tomodachi | train | py |
4f343d18c2a4831a9ef0a86d0aae2fb0b4c74340 | diff --git a/spec/building_block_spec.rb b/spec/building_block_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/building_block_spec.rb
+++ b/spec/building_block_spec.rb
@@ -44,17 +44,4 @@ describe Cxxproject::BuildingBlock do
end.to raise_exception(RuntimeError, 'ERROR: while reading config file for 1: dependent building block "unresolved" was specified but not found!')
end
- it 'should calc correct transitive_config_files' do
- lib1 = Cxxproject::SourceLibrary.new('1').
- set_config_files(['config1']).
- set_project_dir('.')
- lib2 = Cxxproject::SourceLibrary.new('2').
- set_dependencies(['1']).
- set_config_files(['config2']).
- set_project_dir('.')
- tc_array = lib2.transitive_config_files
- tc_array.length.should eq(2)
- tc_array.include?('config1').should eq(true)
- tc_array.include?('config2').should eq(true)
- end
end | removed tests for transitive_configs | marcmo_cxxproject | train | rb |
24843c74f05446ef694477825dc6475c9efbbab5 | diff --git a/squarespace-server.js b/squarespace-server.js
index <HASH>..<HASH> 100644
--- a/squarespace-server.js
+++ b/squarespace-server.js
@@ -201,9 +201,9 @@ renderResponse = function ( appRequest, appResponse ) {
} else {
sqsMiddleware.getJson( url, qrs, function ( error, json ) {
if ( !error ) {
- functions.writeJson( path.join( serverConfig.cacheroot, (cacheName + ".json") ), json );
+ functions.writeJson( path.join( serverConfig.cacheroot, (cacheName + ".json") ), json.json );
- appResponse.status( 200 ).json( json );
+ appResponse.status( 200 ).json( json.json );
} else {
// Handle errors | correctly send and cache page json returned from the middleware. | NodeSquarespace_node-squarespace-server | train | js |
665f5d03e1bd30f886dc2108e4964ca0c2d1d7ad | diff --git a/desktop/ui/src/main/java/org/datacleaner/windows/DataCloudLogInWindow.java b/desktop/ui/src/main/java/org/datacleaner/windows/DataCloudLogInWindow.java
index <HASH>..<HASH> 100644
--- a/desktop/ui/src/main/java/org/datacleaner/windows/DataCloudLogInWindow.java
+++ b/desktop/ui/src/main/java/org/datacleaner/windows/DataCloudLogInWindow.java
@@ -247,8 +247,9 @@ public class DataCloudLogInWindow extends AbstractDialog {
final JButton acceptButton = WidgetFactory.createPrimaryButton("Accept", IconUtils.ACTION_SAVE_BRIGHT);
final JXEditorPane tacArea = new JXEditorPane();
try {
- tacArea.setText(RemoteServersUtils.getDataCloudTermsAndConditions());
+ String tac = RemoteServersUtils.getDataCloudTermsAndConditions();
tacArea.setContentType("text/html");
+ tacArea.setText(tac);
tacArea.setCaretPosition(0);
} catch (IOException e) {
// TODO | T&C was not displayed - editor pane's content-type must be set before a text is set in it | datacleaner_DataCleaner | train | java |
bb7dfe62dddf37ee82b0754a873fe730a158de31 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,6 +17,7 @@ import sys, os
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
+sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ----------------------------------------------------- | can readthedocs find apilinks? | meejah_txtorcon | train | py |
99382b6ee9eb821802fccab42c7b40efadca9f31 | diff --git a/src/main/java/net/jodah/lyra/config/ChannelConfig.java b/src/main/java/net/jodah/lyra/config/ChannelConfig.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/jodah/lyra/config/ChannelConfig.java
+++ b/src/main/java/net/jodah/lyra/config/ChannelConfig.java
@@ -42,7 +42,8 @@ public interface ChannelConfig extends ConsumerConfig {
boolean isExchangeRecoveryEnabled();
/**
- * Returns whether queue and queue binding recovery is enabled. Defaults to true when channel
+ * Returns whether queue and queue binding recovery is enabled. Queue recovery will recover any
+ * queues that are created with autoDelete=true or durable=false. Defaults to true when channel
* recovery is configured.
*
* @see #withQueueRecovery(boolean)
@@ -70,7 +71,8 @@ public interface ChannelConfig extends ConsumerConfig {
ConsumerConfig withExchangeRecovery(boolean enabled);
/**
- * Sets whether queue and queue binding recovery is enabled or not.
+ * Sets whether queue and queue binding recovery is enabled or not. Queue recovery will recover
+ * any queues that are created with autoDelete=true or durable=false.
*/
ConsumerConfig withQueueRecovery(boolean enabled);
} | Better Javadocs for queue recovery. | jhalterman_lyra | train | java |
96d9add659867ceab2d8b29504565cf51737cda2 | diff --git a/outline/manager.js b/outline/manager.js
index <HASH>..<HASH> 100644
--- a/outline/manager.js
+++ b/outline/manager.js
@@ -380,8 +380,21 @@ module.exports = function (doc) {
async function getRelevantPanes (panes, subject, dom) {
const relevantPanes = panes.list.filter(pane => pane.label(subject, dom) && !pane.global)
+ if (relevantPanes.length === 0) {
+ // there are no relevant panes, simply return default pane (which ironically is internalPane)
+ return [panes.internal]
+ }
const filteredPanes = await UI.authn.filterAvailablePanes(relevantPanes)
- return filteredPanes.length ? filteredPanes : [panes.internalPane]
+ if (filteredPanes.length === 0) {
+ // if no relevant panes are available panes because of user role, we still allow for the most relevant pane to be viewed
+ return [relevantPanes[0]]
+ }
+ const firstRelevantPaneIndex = panes.list.indexOf(relevantPanes[0])
+ const firstFilteredPaneIndex = panes.list.indexOf(filteredPanes[0])
+ // if the first relevant pane is loaded before the panes available wrt role, we still want to offer the most relevant pane
+ return firstRelevantPaneIndex < firstFilteredPaneIndex
+ ? [relevantPanes[0]].concat(filteredPanes)
+ : filteredPanes
}
function getPane (relevantPanes, subject) { | Show most relevant pane in some cases
Handle the case that Tim describes in <URL> | solid_solid-panes | train | js |
9fdd4a8b1f07c60c2b6442c5aa1af924b337a183 | diff --git a/pyked/tests/test_chemked.py b/pyked/tests/test_chemked.py
index <HASH>..<HASH> 100644
--- a/pyked/tests/test_chemked.py
+++ b/pyked/tests/test_chemked.py
@@ -17,6 +17,9 @@ import pytest
from ..validation import schema, OurValidator, yaml, Q_
from ..chemked import ChemKED, DataPoint
from ..converters import get_datapoints, get_common_properties
+from .._version import __version__
+
+schema['chemked-version']['allowed'].append(__version__)
warnings.simplefilter('always')
diff --git a/pyked/tests/test_validation.py b/pyked/tests/test_validation.py
index <HASH>..<HASH> 100644
--- a/pyked/tests/test_validation.py
+++ b/pyked/tests/test_validation.py
@@ -12,6 +12,7 @@ import pytest
import yaml
from ..validation import schema, OurValidator, compare_name, property_units
+from .._version import __version__
def no_internet(host='8.8.8.8', port=53, timeout=1):
@@ -29,6 +30,8 @@ def no_internet(host='8.8.8.8', port=53, timeout=1):
internet_missing = pytest.mark.skipif(no_internet(), reason='Internet not available')
+schema['chemked-version']['allowed'].append(__version__)
+
v = OurValidator(schema) | Allow alpha versions to be specified during testing | pr-omethe-us_PyKED | train | py,py |
0fcf1a6a40f603650966ea4051740ac9657936f7 | diff --git a/rest_framework_gis/serializers.py b/rest_framework_gis/serializers.py
index <HASH>..<HASH> 100644
--- a/rest_framework_gis/serializers.py
+++ b/rest_framework_gis/serializers.py
@@ -49,7 +49,7 @@ class GeoFeatureModelSerializer(GeoModelSerializer):
# if 'fields' are declared, make sure it includes 'geo_field'
if self.opts.fields:
if self.opts.geo_field not in self.opts.fields:
- self.opts.fields.extend(self.opts.geo_field)
+ self.opts.fields.append(self.opts.geo_field)
def to_native(self, obj): | make sure geo_field is always included even when fields are explicitly specified | djangonauts_django-rest-framework-gis | train | py |
8bdc6fd615030e802895149ab97fdebea68d1282 | diff --git a/Model/Report.php b/Model/Report.php
index <HASH>..<HASH> 100644
--- a/Model/Report.php
+++ b/Model/Report.php
@@ -21,51 +21,53 @@ use Sylius\Component\Report\Renderer\DefaultRenderers;
class Report implements ReportInterface
{
/**
- *@var integer
+ * @var integer
*/
- private $id;
+ protected $id;
/**
* @var string
*/
- private $name;
+ protected $name;
/**
* @var string
*/
- private $description;
+ protected $description;
/**
* @var string
*/
- private $code;
+ protected $code;
/**
* Renderer name.
*
* @var string
*/
- private $renderer = DefaultRenderers::TABLE;
+ protected $renderer = DefaultRenderers::TABLE;
/**
* @var array
*/
- private $rendererConfiguration = array();
+ protected $rendererConfiguration = array();
/**
* Data fetcher name.
*
* @var string
*/
- private $dataFetcher = DefaultDataFetchers::USER_REGISTRATION;
+ protected $dataFetcher = DefaultDataFetchers::USER_REGISTRATION;
/**
* @var array
*/
- private $dataFetcherConfiguration = array();
+ protected $dataFetcherConfiguration = array();
/**
* {@inheritdoc}
+ *
+ * @return integer
*/
public function getId()
{ | [Report] Replace private variable declarations with protected ones | Sylius_Report | train | php |
9903cdced242f5a77360d31b20351fedfa7221f7 | diff --git a/pycbc/strain.py b/pycbc/strain.py
index <HASH>..<HASH> 100644
--- a/pycbc/strain.py
+++ b/pycbc/strain.py
@@ -62,11 +62,14 @@ def from_cli(opt, dyn_range_fac=1, precision='single'):
end_time=opt.gps_end_time+opt.pad_data)
if opt.zpk_z and opt.zpk_p and opt.zpk_k:
+ logging.info("Highpass Filtering")
+ strain = highpass(strain, frequency=opt.strain_high_pass)
+
logging.info("Applying zpk filter")
- z = -2*numpy.pi* numpy.array(opt.zpk_z)
- p = -2*numpy.pi* numpy.array(opt.zpk_p)
- k = opt.zpk_k
- strain = filter_zpk_factored(strain.astype(numpy.float64), z, p, k)
+ z = numpy.array(opt.zpk_z)
+ p = numpy.array(opt.zpk_p)
+ k = float(opt.zpk_k)
+ strain = filter_zpk(strain.astype(numpy.float64), z, p, k)
if opt.normalize_strain:
logging.info("Dividing strain by constant") | In pycbc.strain high-pass filter before doing zero-pole-gain filter.
Also now pass filter_zpk frequencies instead of angular frequencies
since the input to the function has been changed. | gwastro_pycbc | train | py |
b83d16801120d9449447afee6c5dfc4e31b584fe | diff --git a/src/Codeception/Util/JsonArray.php b/src/Codeception/Util/JsonArray.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Util/JsonArray.php
+++ b/src/Codeception/Util/JsonArray.php
@@ -145,7 +145,7 @@ class JsonArray
continue;
}
- if ($value1 == $value2 && !isset($matchedKeys[$key2])) {
+ if ($this->isEqualValue($value1, $value2) && !isset($matchedKeys[$key2])) {
$ret[$key1] = $value1;
$matchedKeys[$key2] = true;
break;
@@ -173,7 +173,7 @@ class JsonArray
$ret[$key] = $return;
continue;
}
- if ($arr1[$key] == $arr2[$key]) {
+ if ($this->isEqualValue($arr1[$key], $arr2[$key])) {
$ret[$key] = $arr1[$key];
}
}
@@ -211,4 +211,17 @@ class JsonArray
}
}
}
+
+ private function isEqualValue($val1, $val2)
+ {
+ if (is_numeric($val1)) {
+ $val1 = (string) $val1;
+ }
+
+ if (is_numeric($val2)) {
+ $val2 = (string) $val2;
+ }
+
+ return $val1 === $val2;
+ }
} | replace weak check with special case for numbers | Codeception_base | train | php |
1f60dd24e71899b62556229918e15f27ec70f872 | diff --git a/django_summernote/models.py b/django_summernote/models.py
index <HASH>..<HASH> 100644
--- a/django_summernote/models.py
+++ b/django_summernote/models.py
@@ -2,11 +2,7 @@ from __future__ import unicode_literals
from django.db import models
from django.core.files.storage import default_storage
from django.core.exceptions import ImproperlyConfigured
-
-try:
- from importlib import import_module
-except ImportError:
- from django.utils.importlib import import_module
+from importlib import import_module
from django_summernote.settings import summernote_config | Remove useless try-except for importlib | summernote_django-summernote | train | py |
61d98924208eb30e482984197a4dad4ba1eef352 | diff --git a/bot/multithreading/scheduler.py b/bot/multithreading/scheduler.py
index <HASH>..<HASH> 100644
--- a/bot/multithreading/scheduler.py
+++ b/bot/multithreading/scheduler.py
@@ -42,8 +42,7 @@ class SchedulerApi:
Can be safely called multiple times on the same worker (for workers that support it)
to start a new thread for it.
"""
- thread = threading.Thread(target=worker.run, name=worker.name)
- thread.daemon = True
+ thread = SchedulerThread(worker)
thread.start()
def _start_worker_pool(self, worker: QueueWorkerPool):
@@ -88,3 +87,16 @@ class SchedulerApi:
worker.shutdown()
for worker in self.workers:
worker.shutdown()
+
+
+class SchedulerThread:
+ def __init__(self, worker: Worker):
+ self.worker = worker
+
+ def start(self):
+ thread = threading.Thread(name=self.worker.name, target=self.run)
+ thread.daemon = True
+ thread.start()
+
+ def run(self):
+ self.worker.run() | Encapsulate scheduler-started threads in a SchedulerThread class | alvarogzp_telegram-bot-framework | train | py |
e448245588bf11862eb5d0d574286d1bb6c59c95 | diff --git a/panicwrap.go b/panicwrap.go
index <HASH>..<HASH> 100644
--- a/panicwrap.go
+++ b/panicwrap.go
@@ -22,7 +22,7 @@ func defaultPanicHandler() {
defaultNotifier.Config.logf("bugsnag.handleUncaughtPanic: %v", err)
}
state := HandledState{SeverityReasonUnhandledPanic, SeverityError, true, ""}
- Notify(toNotify, state, Configuration{Synchronous: true})
+ defaultNotifier.NotifySync(toNotify, true, state)
})
if err != nil { | [fix] Ensure fatal panics are notified
Due to a bug in the existing `notifier.NotifySync` method, we end up
using the notifier's config value to determine whether to send
synchronously or async. In the case of a fatal panic (i.e not
`AutoNotified` or `Recover`-ed) it still got sent asynchronously.
This change ensures that it does get sent synchronously. | bugsnag_bugsnag-go | train | go |
f3b18e9b3f7470dcfd47baa5a5aad302b0fd5e1f | diff --git a/polyaxon/scheduler/spawners/dockerizer_spawner.py b/polyaxon/scheduler/spawners/dockerizer_spawner.py
index <HASH>..<HASH> 100644
--- a/polyaxon/scheduler/spawners/dockerizer_spawner.py
+++ b/polyaxon/scheduler/spawners/dockerizer_spawner.py
@@ -48,7 +48,8 @@ class DockerizerSpawner(ProjectJobSpawner):
pod_name = constants.DEPLOYMENT_NAME.format(
job_uuid=self.job_uuid, name=self.DOCKERIZER_JOB_NAME)
- return self.create_or_update_pod(name=pod_name, data=deployment).to_dict()
+ pod_resp, _ = self.create_or_update_pod(name=pod_name, data=deployment)
+ return pod_resp.to_dict()
def stop_dockerizer(self):
pod_name = constants.DEPLOYMENT_NAME.format(job_uuid=self.job_uuid, | Return to_dict from pod_resp | polyaxon_polyaxon | train | py |
69b2a7aae9cb84cc123f0c08f4520a62ebf3a07c | diff --git a/Source/classes/Modal.js b/Source/classes/Modal.js
index <HASH>..<HASH> 100644
--- a/Source/classes/Modal.js
+++ b/Source/classes/Modal.js
@@ -107,6 +107,8 @@ Garnish.Modal = Garnish.Base.extend({
Garnish.Modal.visibleModal = this;
Garnish.Modal.$shade.fadeIn(50);
this.addListener(Garnish.Modal.$shade, 'click', 'hide');
+
+ this.settings.onShow();
},
hide: function()
@@ -121,6 +123,8 @@ Garnish.Modal = Garnish.Base.extend({
Garnish.Modal.visibleModal = null;
Garnish.Modal.$shade.fadeOut('fast');
this.removeListener(Garnish.Modal.$shade, 'click');
+
+ this.settings.onHide();
},
getHeight: function()
@@ -216,7 +220,9 @@ Garnish.Modal = Garnish.Base.extend({
{
relativeElemPadding: 8,
defaults: {
- draggable: true
+ draggable: true,
+ onShow: $.noop(),
+ onHide: $.noop()
},
instances: [],
visibleModal: null, | onShow() and onHide() callbacks for Garnish.Modal | pixelandtonic_garnishjs | train | js |
1bbfeb8f94ea3a9a75af35f4f618be78c46da39f | diff --git a/src/Picqer/Financials/Exact/Model.php b/src/Picqer/Financials/Exact/Model.php
index <HASH>..<HASH> 100644
--- a/src/Picqer/Financials/Exact/Model.php
+++ b/src/Picqer/Financials/Exact/Model.php
@@ -181,4 +181,24 @@ abstract class Model implements \JsonSerializable
]);
return isset($result['UserHasRights']) ? $result['UserHasRights'] : null;
}
+
+ /**
+ * Return the value of the primary key
+ *
+ * @param string $code the value to search for
+ * @param string $key the key being searched (defaults to 'Code')
+ *
+ * @return string (guid)
+ */
+ public function findId($code, $key='Code'){
+ if ( $this->isFillable($key) ) {
+ $format = $this->url == 'crm/Accounts' ? '%18s' : '%s';
+ $filter = sprintf("$key eq '$format'", $code);
+ $request = array('$filter' => $filter, '$top' => 1, '$orderby' => $this->primaryKey);
+ if( $records = $this->connection()->get($this->url, $request) ){
+ return $records[0][$this->primaryKey];
+ }
+ }
+ }
+
} | Added method Model::findId
method search records on a key like 'Code' and returns the value of the
primary key. | picqer_exact-php-client | train | php |
1bbb22784fcc136436670fb3db9ef671923b8140 | diff --git a/app/get.js b/app/get.js
index <HASH>..<HASH> 100644
--- a/app/get.js
+++ b/app/get.js
@@ -44,7 +44,7 @@ export default async function get(app, createContext) {
let props = {}
if (!isRequireable(name)) {
- const inline = window.panelsJson && window.panelsJson[location.hostname]
+ const inline = window.panelsJson && window.panelsJson[name]
if (inline) {
data = inline.module | fix: use the app's domain instead of the location of the page | UXtemple_panels | train | js |
cae52bbb9282ffebea1fc0e13205a3cc37338ff6 | diff --git a/tests/pytesseract_test.py b/tests/pytesseract_test.py
index <HASH>..<HASH> 100644
--- a/tests/pytesseract_test.py
+++ b/tests/pytesseract_test.py
@@ -293,7 +293,7 @@ def test_image_to_data_common_output(test_file_small, output):
elif output is Output.DICT:
confidence_values = expected_dict_result.pop('conf', None)
- assert confidence_values != None
+ assert confidence_values is not None
assert 0 <= confidence_values[-1] <= 100
assert result == expected_dict_result | Fix linting: assertion logic | madmaze_pytesseract | train | py |
b409881783bd94f23a343a249440e8693ed09b11 | diff --git a/raven/utils/json.py b/raven/utils/json.py
index <HASH>..<HASH> 100644
--- a/raven/utils/json.py
+++ b/raven/utils/json.py
@@ -23,16 +23,21 @@ except AttributeError:
JSONDecodeError = ValueError
+ENCODER_BY_TYPE = {
+ uuid.UUID: lambda o: o.hex,
+ datetime.datetime: lambda o: o.strftime('%Y-%m-%dT%H:%M:%SZ'),
+ set: list,
+ frozenset: list,
+ bytes: lambda o: o.decode('utf-8', errors='replace'),
+}
+
+
class BetterJSONEncoder(json.JSONEncoder):
def default(self, obj):
- if isinstance(obj, uuid.UUID):
- return obj.hex
- elif isinstance(obj, datetime.datetime):
- return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
- elif isinstance(obj, (set, frozenset)):
- return list(obj)
- elif isinstance(obj, bytes):
- return obj.decode('utf-8', errors='replace')
+ try:
+ return ENCODER_BY_TYPE[type(obj)](obj)
+ except KeyError:
+ pass
return super(BetterJSONEncoder, self).default(obj) | We actually do a lot of json encoding and this is faster | getsentry_raven-python | train | py |
f5bb7517f616a17d3bc4bdea47babff474eff45c | diff --git a/mopidy_gmusic/session.py b/mopidy_gmusic/session.py
index <HASH>..<HASH> 100644
--- a/mopidy_gmusic/session.py
+++ b/mopidy_gmusic/session.py
@@ -12,7 +12,7 @@ class GMusicSession(object):
def __init__(self):
super(GMusicSession, self).__init__()
logger.info('Mopidy uses Google Music')
- self.api = Webclient()
+ self.api = Webclient(validate=False)
def login(self, username, password):
if self.api.is_authenticated(): | Avoid gmusicapi protocol validation. The Webclient interface is not stable and will be replaced soon anyway. | mopidy_mopidy-gmusic | train | py |
4647d463faeec20f2bbafcdc821145baab7af841 | diff --git a/src/Model/FieldType.php b/src/Model/FieldType.php
index <HASH>..<HASH> 100644
--- a/src/Model/FieldType.php
+++ b/src/Model/FieldType.php
@@ -66,7 +66,7 @@ class FieldType
$sPath = $sPath . 'src/FormBuilder/FieldType/';
if (is_dir($sPath)) {
-
+ Factory::helper('directory');
$aFiles = directory_map($sPath);
foreach ($aFiles as $sFile) {
$sClassName = $sClassNamespace . basename($sFile, '.php'); | Loading directory helper prior to calling directory functions | nails_module-form-builder | train | php |
dd72c9e19a4c3ac261e56cd91a2f1ec1803b5ebf | diff --git a/src/main/java/org/stripesstuff/plugin/waitpage/WaitPageInterceptor.java b/src/main/java/org/stripesstuff/plugin/waitpage/WaitPageInterceptor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/stripesstuff/plugin/waitpage/WaitPageInterceptor.java
+++ b/src/main/java/org/stripesstuff/plugin/waitpage/WaitPageInterceptor.java
@@ -356,7 +356,9 @@ public class WaitPageInterceptor implements Interceptor, ConfigurableComponent {
* @param destination where source flash scope content will be copied
*/
protected void copyFlashScope(FlashScope source, FlashScope destination) {
- destination.putAll(source);
+ for (Map.Entry<String,Object> entry: source.entrySet()) {
+ destination.put(entry.getKey(), entry.getValue());
+ }
}
/**
* Remove all contexts that are expired. | Fixes #<I>. Messages are copied from wait page to final page.
FlashScope.putAll method does not call FlashScope.put method so entries
are not added to request.
FlashScope.put is now called for each wait page's FlashScope entries. | StripesFramework_stripes-stuff | train | java |
023ed6c11e2cfb79b7b89f2bab33969abb684a98 | diff --git a/lib/adapters/sqlite3.js b/lib/adapters/sqlite3.js
index <HASH>..<HASH> 100644
--- a/lib/adapters/sqlite3.js
+++ b/lib/adapters/sqlite3.js
@@ -40,6 +40,9 @@ SQLite3.createConnection = function (url, callback) {
if (callback) {
db.on('open', function () { callback(null, adapter) })
}
+
+ db.serialize()
+
return adapter
} | Put SQLite3 database handles into serial-execution mode | grncdr_node-any-db | train | js |
c57603a86215a50b3827c7156158df16e918b0e3 | diff --git a/lib/helper/WebDriverIO.js b/lib/helper/WebDriverIO.js
index <HASH>..<HASH> 100644
--- a/lib/helper/WebDriverIO.js
+++ b/lib/helper/WebDriverIO.js
@@ -42,7 +42,7 @@ class WebDriverIO extends Helper {
this.options.desiredCapabilities.browserName = config.browser;
this.options.baseUrl = config.url;
if(config.proxy) {
- this.options.desiredCapabilities = config.proxy;
+ this.options.desiredCapabilities.proxy = config.proxy;
}
} | Update the proxy json object for desiredcapabilities | Codeception_CodeceptJS | train | js |
067fc7eba652b8de9b81c530c1468104f7e1148d | diff --git a/kernel/classes/datatypes/ezurl/ezurlobjectlink.php b/kernel/classes/datatypes/ezurl/ezurlobjectlink.php
index <HASH>..<HASH> 100644
--- a/kernel/classes/datatypes/ezurl/ezurlobjectlink.php
+++ b/kernel/classes/datatypes/ezurl/ezurlobjectlink.php
@@ -50,6 +50,10 @@ class eZURLObjectLink extends eZPersistentObject
'sort' => array( 'url_id' => 'asc' ),
'class_name' => 'eZURLObjectLink',
'name' => 'ezurl_object_link' );
+ if ( eZDB::instance()->databaseName() == "oracle" )
+ {
+ $definition['fields']['contentobject_attr_version'] = $definition['fields']['contentobject_attribute_version'];
+ }
return $definition;
} | Fix EZP-<I>: eZOracle: Link management doesn't show Objects using URL
ezcontentobject_attribute column contentobject_attribute_version
is named contentobject_attr_version in oracle.
eZURLObjectLink->definition updated accordingly | ezsystems_ezpublish-legacy | train | php |
492d279c981b66aeea19d4dd5d7708e0878e1040 | diff --git a/Classes/Property/TypeConverter/PackageConverter.php b/Classes/Property/TypeConverter/PackageConverter.php
index <HASH>..<HASH> 100644
--- a/Classes/Property/TypeConverter/PackageConverter.php
+++ b/Classes/Property/TypeConverter/PackageConverter.php
@@ -147,7 +147,20 @@ class PackageConverter extends AbstractTypeConverter
*/
protected function createOrUpdateMaintainers(Package $package, NodeInterface $node)
{
+ $upstreamMaintainers = array_map(function (Package\Maintainer $maintainer) {
+ return $maintainer->getName();
+ }, $package->getMaintainers());
$maintainerStorage = $node->getNode('maintainers');
+ $maintainers = new FlowQuery([$maintainerStorage]);
+ $maintainers = $maintainers->children('[instanceof Neos.MarketPlace:Maintainer]');
+ foreach ($maintainers as $maintainer) {
+ /** @var NodeInterface $maintainer */
+ if (in_array($maintainer->getProperty('title'), $upstreamMaintainers)) {
+ continue;
+ }
+ $maintainer->remove();
+ }
+
foreach ($package->getMaintainers() as $maintainer) {
/** @var Package\Maintainer $maintainer */
$name = Slug::create($maintainer->getName()); | TASK: Remove maintainer not declared on packagist | neos_Neos.MarketPlace | train | php |
2b2260e17fe4dcf5c31bded4faf2e46ee36dfb79 | diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/plugin/in_tail.rb
+++ b/lib/fluent/plugin/in_tail.rb
@@ -926,7 +926,7 @@ module Fluent::Plugin
@fifo << io.readpartial(8192, @iobuf)
@fifo.read_lines(@lines)
- number_bytes_read += @lines.last.size
+ number_bytes_read += @lines.last ? @lines.last.size : 0
limit_bytes_per_second_reached = (number_bytes_read >= @read_bytes_limit_per_second && @read_bytes_limit_per_second > 0)
@log.debug("reading file: #{@path}")
if @lines.size >= @read_lines_limit || limit_bytes_per_second_reached | in_tail: Guard for read empty lines | fluent_fluentd | train | rb |
26d428fd518a7e4e1f533a654924aa8096830b15 | diff --git a/src/Sortable.php b/src/Sortable.php
index <HASH>..<HASH> 100644
--- a/src/Sortable.php
+++ b/src/Sortable.php
@@ -26,7 +26,6 @@ interface Sortable
*
* @param array|\ArrayAccess $ids
* @param int $startOrder
- *
*/
public static function setNewOrder($ids, int $startOrder = 1);
diff --git a/tests/TestCase.php b/tests/TestCase.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -47,7 +47,7 @@ abstract class TestCase extends Orchestra
$table->integer('order_column');
});
- collect(range(1,20))->each(function(int $i) {
+ collect(range(1, 20))->each(function (int $i) {
Dummy::create(['name' => $i]);
});
} | Applied fixes from StyleCI (#<I>) | spatie_eloquent-sortable | train | php,php |
d84380ee7be5fcf16f242540151c0449a4278149 | diff --git a/multiqc/templates/default/assets/js/multiqc_tour.js b/multiqc/templates/default/assets/js/multiqc_tour.js
index <HASH>..<HASH> 100644
--- a/multiqc/templates/default/assets/js/multiqc_tour.js
+++ b/multiqc/templates/default/assets/js/multiqc_tour.js
@@ -85,6 +85,18 @@ var tour_steps = [
backdropPadding: 10,
onHide: function (tour) { $('.mqc-toolbox').css('z-index', orig_z_index); }
},
+ {
+ element: ".highcharts-button:first path",
+ title: "Export Plots",
+ placement: 'left',
+ backdropPadding: {
+ 'top': 5,
+ 'left': 5,
+ 'bottom': 35,
+ 'right': 35,
+ },
+ content: "Plots can be exported in a range of formats (including <code>svg</code> and <code>pdf</code>, suitable for publications)."
+ },
{
element: ".mqc-toolbox-buttons a[href=#mqc_cols]", | Added tour step about exporting plots. | ewels_MultiQC | train | js |
bb3040ef8445b258bc36bafcea44df91b2713fc7 | diff --git a/Library/HTTP/Middleware/AntiCsrf.php b/Library/HTTP/Middleware/AntiCsrf.php
index <HASH>..<HASH> 100644
--- a/Library/HTTP/Middleware/AntiCsrf.php
+++ b/Library/HTTP/Middleware/AntiCsrf.php
@@ -21,7 +21,7 @@ use \Lollipop\HTTP\Response;
/**
* Lollipop AntiCsrf Middleware
*
- * @version 1.0.1
+ * @version 1.0.2
* @author John Aldrich Bernardo
* @email [email protected]
* @package Lollipop
@@ -47,7 +47,7 @@ class AntiCsrf
Cookie::set($acsrf_name, CsrfToken::get(), '/', $expiration);
if (!$req->isMethod('get') && $acsrf_enable) {
- if (!$req->get($acsrf_name) || !CsrfToken::isValid($req->get($acsrf_name))) {
+ if (!CsrfToken::isValid($req->header($acsrf_name)) && !CsrfToken::isValid($req->get($acsrf_name))) {
$output = '<!DOCTYPE html>'
. '<!-- Lollipop for PHP by John Aldrich Bernardo -->'
. '<html>' | HTTP/Middleware/AntiCsrf: header check | jabernardo_lollipop-php | train | php |
eada8fedc41e772b85150a9e13344c8bc3352598 | diff --git a/bin/job-worker.php b/bin/job-worker.php
index <HASH>..<HASH> 100644
--- a/bin/job-worker.php
+++ b/bin/job-worker.php
@@ -8,9 +8,11 @@ use Hodor\Config\LoaderFacade as Config;
use Hodor\JobQueue\QueueFactory as QueueFactory;
$args = new Arguments();
-$config = Config::loadFromFile($args->getConfigFile());
+$config_file = $args->getConfigFile();
+$queue_name = $args->getQueueName();
+$config = Config::loadFromFile($config_file);
$queue_factory = new QueueFactory($config);
-$worker_queue = $queue_factory->getWorkerQueue('default');
+$worker_queue = $queue_factory->getWorkerQueue($queue_name);
$worker_queue->runNext(); | feat(queue): add queue name argument to job-worker | lightster_hodor | train | php |
d42bb3ae6ff69870be3d38814e260c0cc577d204 | diff --git a/app/AppKernel.php b/app/AppKernel.php
index <HASH>..<HASH> 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -113,4 +113,40 @@ class AppKernel extends Kernel
{
$loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
}
+
+ /**
+ * dont rebuild container with debug over and over again during tests
+ *
+ * This is very much what is described in http://kriswallsmith.net/post/27979797907
+ *
+ * @return void
+ */
+ protected function initializeContainer()
+ {
+ static $first = true;
+
+ if ('test' !== $this->getEnvironment()) {
+ parent::initializeContainer();
+ return;
+ }
+
+ $debug = $this->debug;
+
+ if (!$first) {
+ // disable debug mode on all but the first initialization
+ $this->debug = false;
+ }
+
+ // will not work with --process-isolation
+ $first = false;
+
+ try {
+ parent::initializeContainer();
+ } catch (\Exception $e) {
+ $this->debug = $debug;
+ throw $e;
+ }
+
+ $this->debug = $debug;
+ }
} | Only build debug kernel as needed
It seems this also helps at bettering performance... | libgraviton_graviton | train | php |
bdbfb5fafa43b1f17c6d206f5d1253a9f88e23ea | diff --git a/pyemma/coordinates/clustering/kmeans.py b/pyemma/coordinates/clustering/kmeans.py
index <HASH>..<HASH> 100644
--- a/pyemma/coordinates/clustering/kmeans.py
+++ b/pyemma/coordinates/clustering/kmeans.py
@@ -126,8 +126,8 @@ class KmeansClustering(AbstractClustering):
if self._init_strategy == 'uniform':
del self._centers_iter_list
del self._init_centers_indices
-
- self._progress_force_finish(0)
+ if self._init_strategy == 'kmeans++':
+ self._progress_force_finish(0)
self._progress_force_finish(1)
def kmeanspp_center_assigned(self): | [coordinates/kmeans] fixed param_finish in case of uniform center initialization | markovmodel_PyEMMA | train | py |
b78b9c9fd250c8ff1cedb738beb83f2768e05574 | diff --git a/test/integration/create.js b/test/integration/create.js
index <HASH>..<HASH> 100644
--- a/test/integration/create.js
+++ b/test/integration/create.js
@@ -140,6 +140,7 @@ module.exports = function (createFn, setup, dismantle) {
_message: 'Customer validation failed',
errors: {
name: {
+ $isValidatorError: true,
kind: 'required',
message: 'Path `name` is required.',
name: 'ValidatorError',
diff --git a/test/integration/middleware.js b/test/integration/middleware.js
index <HASH>..<HASH> 100644
--- a/test/integration/middleware.js
+++ b/test/integration/middleware.js
@@ -748,6 +748,7 @@ module.exports = function (createFn, setup, dismantle) {
message: 'Customer validation failed: name: Path `name` is required.',
errors: {
name: {
+ $isValidatorError: true,
kind: 'required',
message: 'Path `name` is required.',
name: 'ValidatorError', | fix(test): mongoose validation error tests (#<I>) | florianholzapfel_express-restify-mongoose | train | js,js |
f89cfed4ced04b060a40a6a7128caa8d8129b0e1 | diff --git a/public/js/editors/libraries.js b/public/js/editors/libraries.js
index <HASH>..<HASH> 100644
--- a/public/js/editors/libraries.js
+++ b/public/js/editors/libraries.js
@@ -244,8 +244,12 @@ var libraries = [
"label": "CoffeeScript"
},
{
- "url": "https://github.com/downloads/emberjs/ember.js/ember-0.9.8.1.min.js",
- "label": "Ember.js 0.9.8.1"
+ "url": [
+ "http://code.jquery.com/jquery.min.js",
+ "http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js",
+ "https://github.com/downloads/emberjs/ember.js/ember-1.0.0-pre.2.min.js"
+ ],
+ "label": "Ember.js 1.0.0pre2"
},
{
"url": "http://cdnjs.cloudflare.com/ajax/libs/es5-shim/1.2.4/es5-shim.min.js", | update ember and include jquery & handlebars by default as requested by @wycats | jsbin_jsbin | train | js |
45b8d2531ef6a7c775ca3bac06bcad6ffc5419e3 | diff --git a/test/unit/event.js b/test/unit/event.js
index <HASH>..<HASH> 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -47,15 +47,11 @@ test("bind(), no data", function() {
test("bind(), iframes", function() {
// events don't work with iframes, see #939 - this test fails in IE because of contentDocument
- // var doc = document.getElementById("iframe").contentDocument;
- //
- // doc.body.innerHTML = "<input type='text'/>";
- //
- // var input = doc.getElementsByTagName("input")[0];
- //
- // jQuery(input).bind("click",function() {
- // ok( true, "Binding to element inside iframe" );
- // }).click();
+ var doc = jQuery("#loadediframe").contents();
+
+ jQuery("div", doc).bind("click", function() {
+ ok( true, "Binding to element inside iframe" );
+ }).click().unbind('click');
});
test("bind(), trigger change on select", function() { | enable test for binding events cross-frame that was fixed in r<I> | jquery_jquery | train | js |
d06d9fc5d75283ad8340c3c528d6761b728171f9 | diff --git a/python/ray/experimental/state.py b/python/ray/experimental/state.py
index <HASH>..<HASH> 100644
--- a/python/ray/experimental/state.py
+++ b/python/ray/experimental/state.py
@@ -775,7 +775,7 @@ class GlobalState(object):
num_tasks += self.redis_client.zcount(
event_log_set, min=0, max=time.time())
- if num_tasks is 0:
+ if num_tasks == 0:
return 0, 0, 0
return overall_smallest, overall_largest, num_tasks
diff --git a/python/ray/experimental/ui.py b/python/ray/experimental/ui.py
index <HASH>..<HASH> 100644
--- a/python/ray/experimental/ui.py
+++ b/python/ray/experimental/ui.py
@@ -97,7 +97,7 @@ def get_sliders(update):
with out_recursion:
smallest, largest, num_tasks = ray.global_state._job_length()
diff = largest - smallest
- if num_tasks is not 0:
+ if num_tasks != 0:
# Describes the initial values that the slider/text box
# values should be set to. | Fix Python linting errors. (#<I>) | ray-project_ray | train | py,py |
7218dea80d762da719e9cc9f2ff426a5d26eab9d | diff --git a/runcommands/completion/__init__.py b/runcommands/completion/__init__.py
index <HASH>..<HASH> 100644
--- a/runcommands/completion/__init__.py
+++ b/runcommands/completion/__init__.py
@@ -1,6 +1,7 @@
import glob
import os
import shlex
+from contextlib import redirect_stderr
from ..args import arg
from ..collection import Collection
@@ -30,7 +31,10 @@ def complete(command_line,
tokens = shlex.split(command_line[:position])
all_argv, run_argv, command_argv = run.partition_argv(tokens[1:])
- run_args = run.parse_args(run_argv)
+
+ with open(os.devnull, 'wb') as devnull_fp:
+ with redirect_stderr(devnull_fp):
+ run_args = run.parse_args(run_argv)
module = run_args.get('commands_module')
module = module or DEFAULT_COMMANDS_MODULE | Hide stderr when parsing args in complete command
For example, if an option takes a value, we don't want argparse to show
usage when completing. | wylee_runcommands | train | py |
c72b09173c71f28597e4ed95260b034b1414f2bf | diff --git a/src/mentio.directive.js b/src/mentio.directive.js
index <HASH>..<HASH> 100644
--- a/src/mentio.directive.js
+++ b/src/mentio.directive.js
@@ -572,6 +572,10 @@ angular.module('mentio', [])
}
});
+ scope.parentMentio.$on('$destroy', function () {
+ element.remove();
+ });
+
scope.hideMenu = function () {
scope.visible = false;
element.css('display', 'none'); | Update mentio.directive.js | jeff-collins_ment.io | train | js |
fb0e38df6f029c409e7779653d7feef15f7bb890 | diff --git a/lib/indonesian_stemmer.rb b/lib/indonesian_stemmer.rb
index <HASH>..<HASH> 100644
--- a/lib/indonesian_stemmer.rb
+++ b/lib/indonesian_stemmer.rb
@@ -46,6 +46,10 @@ end
class String
def stem
+ IndonesianStemmer.stem(self.dup)
+ end
+
+ def stem!
IndonesianStemmer.stem(self)
end
end | Fix #stem so that it doesn't modified original string and added #stem! method instead | apraditya_indonesian_stemmer | train | rb |
fbf9fb5201f20b29a046557b6667ffbe8adde9be | diff --git a/gui/test_riabdock.py b/gui/test_riabdock.py
index <HASH>..<HASH> 100644
--- a/gui/test_riabdock.py
+++ b/gui/test_riabdock.py
@@ -45,6 +45,8 @@ from utilities_test import (getQgisTestApp,
from gui.riabdock import (RiabDock, setRasterStyle)
from gui.riabmap import RiabMap
from utilities_test import loadLayer
+from storage.utilities_test import TESTDATA
+from storage.utilities import read_keywords
try:
from pydevd import * | Added import that got lost in merge from master | inasafe_inasafe | train | py |
98ef2ce941451ece8be61c857836c44a5c3374e5 | diff --git a/tests/functional/test_photos.py b/tests/functional/test_photos.py
index <HASH>..<HASH> 100644
--- a/tests/functional/test_photos.py
+++ b/tests/functional/test_photos.py
@@ -75,6 +75,7 @@ class TestPhotos(test_base.TestBase):
self._delete_all()
self._create_test_photos()
+ @unittest.skip("This test doesn't work if the server is behind a cache")
def test_delete_source(self):
""" Test that photo source files can be deleted """
# Upload a new (duplicate) public photo | Skip the photo.delete_source test, since it doesn't work if the photos are cached | photo_openphoto-python | train | py |
99fff0269e877a7e979a81111096eb6a8f9d27c7 | diff --git a/lib/storytime.rb b/lib/storytime.rb
index <HASH>..<HASH> 100644
--- a/lib/storytime.rb
+++ b/lib/storytime.rb
@@ -55,7 +55,7 @@ module Storytime
# Storytime::PostgresSearchAdapter, Storytime::MysqlSearchAdapter,
# Storytime::MysqlFulltextSearchAdapter, Storytime::Sqlite3SearchAdapter
mattr_accessor :search_adapter
- @@search_adapter = Storytime::PostgresSearchAdapter
+ @@search_adapter = ''
class << self
attr_accessor :layout, :media_storage, :s3_bucket, :post_types | Default search_adapter to none | CultivateLabs_storytime | train | rb |
81731f2f1005743d0be3cf796b4fd3ef4d4b782d | diff --git a/src/EscapeWork/Assets/AssetsServiceProvider.php b/src/EscapeWork/Assets/AssetsServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/EscapeWork/Assets/AssetsServiceProvider.php
+++ b/src/EscapeWork/Assets/AssetsServiceProvider.php
@@ -24,12 +24,12 @@ class AssetsServiceProvider extends ServiceProvider
$this->app['escapework.asset'] = $this->app->share(function($app)
{
- return new Asset($app, $app['config']);
+ return new Asset($app, $app['config'], $app['cache']);
});
$this->app['escapework.asset.command'] = $this->app->share(function($app)
{
- return new Commands\AssetDistCommand($app['config'], $app['files'], array(
+ return new Commands\AssetDistCommand($app['config'], $app['files'], $app['cache'], array(
'app' => app_path(),
'public' => public_path(),
)); | Fixed AssetsServiceProvider with the new dependencies | EscapeWork_laravel-asset-versioning | train | php |
c08400e2bca6af6c65d228c666a5c35a3e67bfc3 | diff --git a/pre_commit/repository.py b/pre_commit/repository.py
index <HASH>..<HASH> 100644
--- a/pre_commit/repository.py
+++ b/pre_commit/repository.py
@@ -78,9 +78,7 @@ class Repository(object):
logger.error(
'`{}` is not present in repository {}. '
'Typo? Perhaps it is introduced in a newer version? '
- 'Often you can fix this by removing the hook, running '
- '`pre-commit autoupdate`, '
- 'and then adding the hook.'.format(
+ 'Often `pre-commit autoupdate` fixes this.'.format(
hook['id'], self.repo_config['repo'],
)
)
diff --git a/tests/repository_test.py b/tests/repository_test.py
index <HASH>..<HASH> 100644
--- a/tests/repository_test.py
+++ b/tests/repository_test.py
@@ -696,9 +696,7 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
assert fake_log_handler.handle.call_args[0][0].msg == (
'`i-dont-exist` is not present in repository {}. '
'Typo? Perhaps it is introduced in a newer version? '
- 'Often you can fix this by removing the hook, '
- 'running `pre-commit autoupdate`, '
- 'and then adding the hook.'.format(path)
+ 'Often `pre-commit autoupdate` fixes this.'.format(path)
) | Improve messaging for missing hook given #<I> | pre-commit_pre-commit | train | py,py |
ab1f5931a03688c46aed31f4714d726aa81aea95 | diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java
index <HASH>..<HASH> 100644
--- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java
+++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java
@@ -98,7 +98,6 @@ public class DispatcherServletAutoConfiguration {
@Bean(name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
public DispatcherServlet dispatcherServlet() {
DispatcherServlet dispatcherServlet = new DispatcherServlet();
- dispatcherServlet.setShouldHandleFailure(true);
dispatcherServlet.setDispatchOptionsRequest(
this.webMvcProperties.isDispatchOptionsRequest());
dispatcherServlet.setDispatchTraceRequest( | Disable DispatcherServlet shouldHandleFailure
This change broke a Spring Security sample, reverting it.
See gh-<I> | spring-projects_spring-boot | train | java |
7919eb95cf305e5802dbcfebc8aa94ee5079845d | diff --git a/templates/account.php b/templates/account.php
index <HASH>..<HASH> 100755
--- a/templates/account.php
+++ b/templates/account.php
@@ -158,6 +158,7 @@
<li> • </li>
<?php endif ?>
<?php if ( $is_paying ) : ?>
+ <?php if ( ! fs_is_network_admin() ) : ?>
<li>
<form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
<input type="hidden" name="fs_action" value="deactivate_license">
@@ -168,6 +169,7 @@
</form>
</li>
<li> • </li>
+ <?php endif ?>
<?php if ( ! $license->is_lifetime() &&
$is_active_subscription
) : ?> | [multisite] [account] [license] Don't show the "Deactivate License" link on the "Account Details" section of the network-level "Account" page. | Freemius_wordpress-sdk | train | php |
83bce003087643f6cf17cfb2a5b47be0406c6871 | diff --git a/lib/sqlHandler.js b/lib/sqlHandler.js
index <HASH>..<HASH> 100644
--- a/lib/sqlHandler.js
+++ b/lib/sqlHandler.js
@@ -75,10 +75,9 @@ SqlStore.prototype.populate = function(callback) {
}
if (!self.sequelizeInstanceInfo.synced) {
- self.sequelize.sync({ force: true }).asCallback(onSynced);
- } else {
- onSynced();
+ return self.sequelize.sync({ force: true }).asCallback(onSynced);
}
+ return onSynced();
};
SqlStore.prototype._buildModels = function() { | Prefer "return early" to `else` block. | holidayextras_jsonapi-store-relationaldb | train | js |
fa40b3b52684d9886d47b3fb8bb7ef413b60c320 | diff --git a/lib/ovirt/vm.rb b/lib/ovirt/vm.rb
index <HASH>..<HASH> 100644
--- a/lib/ovirt/vm.rb
+++ b/lib/ovirt/vm.rb
@@ -5,7 +5,7 @@ module OVIRT
class VM < BaseObject
attr_reader :description, :status, :memory, :profile, :display, :host, :cluster, :template
- attr_reader :storage, :cores, :creation_time, :os, :ha, :ha_priority, :ips, :vnc, :quota
+ attr_reader :storage, :cores, :creation_time, :os, :ha, :ha_priority, :ips, :vnc, :quota, :clone
attr_accessor :interfaces, :volumes
def initialize(client, xml)
@@ -95,6 +95,7 @@ module OVIRT
priority_(opts[:ha_priority]) unless opts[:ha_priority].nil?
}
end
+ disks_ { clone_(opts[:clone]) } if opts[:clone]
display_{
type_(opts[:display][:type])
} if opts[:display]
@@ -282,6 +283,8 @@ module OVIRT
interfaces = xml/'nics/nic'
@interfaces = interfaces.length > 0 ? interfaces.collect {|nic| OVIRT::Interface::new(@client, nic)} : nil
+
+ @clone = ((xml/'disks/clone').first.text rescue nil)
end
end | Impelment 'clone' attribute for VM to support creation of full clones | abenari_rbovirt | train | rb |
6972c07a61c374fc3782da7be5f97df5abb1fbba | diff --git a/course/unenrol.php b/course/unenrol.php
index <HASH>..<HASH> 100644
--- a/course/unenrol.php
+++ b/course/unenrol.php
@@ -14,6 +14,13 @@
$userid = optional_param('user', 0, PARAM_INT); //course
$confirm = optional_param('confirm', 0, PARAM_BOOL);
+ if($userid == $USER->id){
+ // the rest of this code assumes $userid=0 means
+ // you are unassigning yourself, so set this for the
+ // correct capabiliy checks & language later
+ $userid = 0;
+ }
+
if (! $course = get_record('course', 'id', $id) ) {
error('Invalid course id');
} | MDL-<I> - unenrolling self wasn't working properly from user profile
because unenrol.php was doing wrong capability check when $userid set.o
Also improves the lanaguage used when unenrolling self.
merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
5519f83f60c7a1ba9393121788cba476da81ce6c | diff --git a/tasks/docs.rb b/tasks/docs.rb
index <HASH>..<HASH> 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -160,7 +160,7 @@ namespace :docs_site do
#
def action_list(actions)
list = {}
- actions.each do |action|
+ actions.sort.each do |action|
# skip it so we can make it the last value later
next if action == "nothing" | Sort the list of actions when generating docs | chef_chef | train | rb |
413ffdfd8a46131370fb981d3731f365ab891997 | diff --git a/lib/Parser.constants.js b/lib/Parser.constants.js
index <HASH>..<HASH> 100644
--- a/lib/Parser.constants.js
+++ b/lib/Parser.constants.js
@@ -76,7 +76,10 @@ for (i=0,keys=Object.keys(DISCONNECT_REASON),len=keys.length; i<len; ++i)
DISCONNECT_REASON[DISCONNECT_REASON[keys[i]]] = keys[i];
var CHAN_OPEN_FAILURE = exports.CHAN_OPEN_FAILURE = {
- ADMINISTRATIVELY_PROHIBITED: 1
+ ADMINISTRATIVELY_PROHIBITED: 1,
+ CONNECT_FAILED: 2,
+ UNKNOWN_CHANNEL_TYPE: 3,
+ RESOURCE_SHORTAGE: 4
};
for (i=0,keys=Object.keys(CHAN_OPEN_FAILURE),len=keys.length; i<len; ++i)
CHAN_OPEN_FAILURE[CHAN_OPEN_FAILURE[keys[i]]] = keys[i]; | parser constants: add more channel open failure reason codes | mscdex_ssh2 | train | js |
b7f4e08661cd149a29ae7107241a16928dc606eb | diff --git a/lib/configuration/variables/sources/resolve-external-plugin-sources.js b/lib/configuration/variables/sources/resolve-external-plugin-sources.js
index <HASH>..<HASH> 100644
--- a/lib/configuration/variables/sources/resolve-external-plugin-sources.js
+++ b/lib/configuration/variables/sources/resolve-external-plugin-sources.js
@@ -48,10 +48,7 @@ module.exports = (configuration, resolverConfiguration, externalPlugins) => {
resolverConfiguration.sources[sourceName] = sourceConfig;
resolverConfiguration.fulfilledSources.add(sourceName);
}
- } else if (
- externalPlugin.variableResolvers &&
- configuration.variablesResolutionMode < 20210326
- ) {
+ } else if (externalPlugin.variableResolvers) {
logDeprecation(
'NEW_VARIABLES_RESOLVER',
`Plugin "${pluginName}" attempts to extend old variables resolver. ` + | fix(Variables): Unconditionally deprecate old vars engine extensions | serverless_serverless | train | js |
54542e06897200d42b1526d1ad179b52204ac603 | diff --git a/vendor/k8s.io/kubernetes/pkg/volume/azure_dd/azure_common.go b/vendor/k8s.io/kubernetes/pkg/volume/azure_dd/azure_common.go
index <HASH>..<HASH> 100644
--- a/vendor/k8s.io/kubernetes/pkg/volume/azure_dd/azure_common.go
+++ b/vendor/k8s.io/kubernetes/pkg/volume/azure_dd/azure_common.go
@@ -41,6 +41,7 @@ import (
const (
defaultFSType = "ext4"
defaultStorageAccountType = storage.StandardLRS
+ defaultAzureDiskKind = v1.AzureSharedBlobDisk
)
type dataDisk struct {
@@ -120,7 +121,7 @@ func normalizeFsType(fsType string) string {
func normalizeKind(kind string) (v1.AzureDataDiskKind, error) {
if kind == "" {
- return v1.AzureDedicatedBlobDisk, nil
+ return defaultAzureDiskKind, nil
}
if !supportedDiskKinds.Has(kind) { | UPSTREAM: <I>: fix azure storage account num exhausting issue | openshift_origin | train | go |
0e7bbe699e32f5902a04e57b678ffeb5478320af | diff --git a/svtyper/singlesample.py b/svtyper/singlesample.py
index <HASH>..<HASH> 100644
--- a/svtyper/singlesample.py
+++ b/svtyper/singlesample.py
@@ -264,7 +264,7 @@ def make_detailed_empty_genotype(variant, sample):
return variant
def check_split_read_evidence(sam_fragment, breakpoint, split_slop):
- (ref_seq, alt_seq, alt_clip) = (0.0, 0.0, 0.0)
+ (ref_seq, alt_seq, alt_clip) = (0, 0, 0)
# get reference sequences
for read in sam_fragment.primary_reads: | + init the split read evidence like the original svtyper
- use 0 instead of <I> | hall-lab_svtyper | train | py |
d021d9b49bc8fd52ec8b6313b4fb2d8002681de8 | diff --git a/test/lib/test_search.js b/test/lib/test_search.js
index <HASH>..<HASH> 100644
--- a/test/lib/test_search.js
+++ b/test/lib/test_search.js
@@ -288,7 +288,9 @@ TestSearch.prototype.reportResult = function reportResult(res, assert) {
}
} else {
if (res.passed) {
- assert.pass(self.describeState(res.state));
+ if (!self.options.silentPass) {
+ assert.pass(self.describeState(res.state));
+ }
} else {
for (i = 0; i < res.results.length; i++) {
assert.emit('result', res.results[i]);
@@ -297,7 +299,12 @@ TestSearch.prototype.reportResult = function reportResult(res, assert) {
}
};
-TestSearch.prototype.report = function report(/* assert */) {
+TestSearch.prototype.report = function report(assert) {
+ var self = this;
+
+ if (self.options.silentPass && !self.fail) {
+ assert.pass('all ' + self.pass + ' cases passed');
+ }
};
TestSearch.prototype.run = function run(assert, options, callback) { | TestSearch: add support for single aggregated output | uber_tchannel-node | train | js |
07ddb6af69e4c62ce3806d34f077aa1db0ca76b1 | diff --git a/src/transforms/Bin.js b/src/transforms/Bin.js
index <HASH>..<HASH> 100644
--- a/src/transforms/Bin.js
+++ b/src/transforms/Bin.js
@@ -17,6 +17,7 @@ var prototype = inherits(Bin, Transform);
prototype.transform = function(_, pulse) {
var bins = this._bins(_),
+ start = bins.start,
step = bins.step,
as = _.as || ['bin0', 'bin1'],
b0 = as[0],
@@ -27,8 +28,12 @@ prototype.transform = function(_, pulse) {
pulse.visit(flag, function(t) {
var v = bins(t);
+ // minimum bin value (inclusive)
t[b0] = v;
- t[b1] = v != null ? v + step : null;
+ // maximum bin value (exclusive)
+ // use convoluted math for better floating point agreement
+ // see https://github.com/vega/vega/issues/830
+ t[b1] = v == null ? null : start + step * (1 + (v - start) / step);
});
return pulse.modifies(as); | Fix bin boundary calc for floating point issues. | vega_vega-dataflow | train | js |
0b4f1431e6d75b28161d10c6a47e92b2b7f9981a | diff --git a/lib/big_index/adapters/abstract_adapter.rb b/lib/big_index/adapters/abstract_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/big_index/adapters/abstract_adapter.rb
+++ b/lib/big_index/adapters/abstract_adapter.rb
@@ -3,7 +3,7 @@ module BigIndex
class AbstractAdapter
- attr_reader :name, :options
+ attr_reader :name, :options, :connection
def adapter_name
'abstract'
@@ -29,6 +29,10 @@ module BigIndex
field_type
end
+ def execute(request)
+ raise NotImplementedError
+ end
+
def index_save(model)
raise NotImplementedError
end
diff --git a/lib/big_index/adapters/solr_adapter.rb b/lib/big_index/adapters/solr_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/big_index/adapters/solr_adapter.rb
+++ b/lib/big_index/adapters/solr_adapter.rb
@@ -5,8 +5,6 @@ module BigIndex
include ::Solr::AdapterMethods
- attr_reader :connection
-
# BigIndex Adapter API methods ====================================
def adapter_name
@@ -101,6 +99,10 @@ module BigIndex
end
end
+ def execute(request)
+ @connection.solr_execute(request)
+ end
+
def index_save(model)
configuration = model.index_configuration | Bigindex update
* Modified the SolrAdapter structure slightly. | openplaces_bigindex | train | rb,rb |
d768f632c9f79684945894cdb6f402ebfab00a2e | diff --git a/lib/neuron/slick/adapter.js b/lib/neuron/slick/adapter.js
index <HASH>..<HASH> 100644
--- a/lib/neuron/slick/adapter.js
+++ b/lib/neuron/slick/adapter.js
@@ -46,7 +46,12 @@ Slick = K.Slick;
K.S = {
/**
- * @param {Array|Object} append the found elements will be appended to the end of the `append` subject
+ * @param {string|DOMElement} selector
+ * @param {(Array.<DOMElement>|Object)=} (Object-> Array-like object) context
+ * @param {(Array|Object)=} append the found elements will be appended to the end of the `append` subject
+ * @param {boolean=} first
+
+ * @returns {Array} (or Array-like Object) always the `append` subject
*/
find: function(selector, context, append, first){
context || (context = document); | slick/adapter: add comments | kaelzhang_neuron.js | train | js |
93f0fe9857d472df74351fe4a92f8b082ea8f46d | diff --git a/generators/connection/index.js b/generators/connection/index.js
index <HASH>..<HASH> 100644
--- a/generators/connection/index.js
+++ b/generators/connection/index.js
@@ -309,7 +309,6 @@ module.exports = class ConnectionGenerator extends Generator {
// NOTE (EK): If this is the first time we set this up
// show this nice message.
if (connectionString && !this.defaultConfig[database]) {
- const databaseName = snakeCase(this.pkg.name);
this.log();
this.log(`Woot! We've set up your ${database} database connection!`);
@@ -320,7 +319,7 @@ module.exports = class ConnectionGenerator extends Generator {
// case 'oracle':
case 'postgres': // eslint-disable-line no-fallthrough
case 'rethinkdb':
- this.log(`Make sure that your ${database} database is running, the username/role is correct, and the database "${databaseName}" has been created.`);
+ this.log(`Make sure that your ${database} database is running, the username/role is correct, and "${connectionString}" is reachable and the database has been created.`);
this.log('Your configuration can be found in the projects config/ folder.');
break;
} | Fix summary for generated connection (#<I>) | feathersjs_generator-feathers | train | js |
8a75b5676462282835bbb452cd5f6dd3773e9563 | diff --git a/brome/core/model/basetest.py b/brome/core/model/basetest.py
index <HASH>..<HASH> 100644
--- a/brome/core/model/basetest.py
+++ b/brome/core/model/basetest.py
@@ -261,6 +261,8 @@ class BaseTest(object):
if config.get('enable_proxy'):
chrome_options.add_argument('--proxy-server=%s'%mitm_proxy)
+ if config.get('mobile_emulation'):
+ chrome_options.add_experimental_option("mobileEmulation", config.get('mobile_emulation'))
desired_cap=chrome_options.to_capabilities() | Support mobile emulation in remote | jf-parent_brome | train | py |
3d9d93f23e6303da4516f56491d06ef3acb024e4 | diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js
index <HASH>..<HASH> 100644
--- a/js/bootstrap-select.js
+++ b/js/bootstrap-select.js
@@ -1507,7 +1507,8 @@
function addOptgroup (index, selectOptions) {
var optgroup = selectOptions[index],
- previous = selectOptions[index - 1],
+ // skip placeholder option
+ previous = index - 1 < startIndex ? false : selectOptions[index - 1],
next = selectOptions[index + 1],
options = optgroup.querySelectorAll('option' + optionSelector); | don't use placeholder option when determining whether or not a divider should be shown (#<I>) | snapappointments_bootstrap-select | train | js |
fdd99aa6ff00102fdfa582e3c97b6aa0204094ae | diff --git a/holoviews/element/raster.py b/holoviews/element/raster.py
index <HASH>..<HASH> 100644
--- a/holoviews/element/raster.py
+++ b/holoviews/element/raster.py
@@ -206,7 +206,7 @@ class HeatMap(Raster):
dimensions['key_dimensions'] = data.key_dimensions
if 'value_dimensions' not in params:
dimensions['value_dimensions'] = data.value_dimensions
- elif isinstance(dict, OrderedDict, type(None)):
+ elif isinstance(data, (dict, OrderedDict, type(None))):
data = NdMapping(data, **dimensions)
else:
raise TypeError('HeatMap only accepts dict or NdMapping types.') | Fixed isinstance check on HeatMap | pyviz_holoviews | train | py |
a437c4afc05b806e6b76a1bec57d8a8e85c02627 | diff --git a/src/js/EventHandler.js b/src/js/EventHandler.js
index <HASH>..<HASH> 100644
--- a/src/js/EventHandler.js
+++ b/src/js/EventHandler.js
@@ -631,10 +631,10 @@ define([
layoutInfo.editor.data('options', options);
// ret styleWithCSS for backColor / foreColor clearing with 'inherit'.
- if (options.styleWithSpan && !agent.isMSIE) {
+ if (!agent.isMSIE) {
// protect FF Error: NS_ERROR_FAILURE: Failure
setTimeout(function () {
- document.execCommand('styleWithCSS', 0, true);
+ document.execCommand('styleWithCSS', 0, options.styleWithSpan);
}, 0);
} | Correction for styleWithSpan setting
This correction makes sure that if I don't want to style with a span, it will not. Previously this function was purely passive, and only enforced styling with spans... a browser defaulting to css styling would continue to do so regardless of this setting. | summernote_summernote | train | js |
bf34a26b7d00bdf961c973353bdddfa88e2dbbee | diff --git a/cloudvolume/datasource/graphene/mesh/sharded.py b/cloudvolume/datasource/graphene/mesh/sharded.py
index <HASH>..<HASH> 100644
--- a/cloudvolume/datasource/graphene/mesh/sharded.py
+++ b/cloudvolume/datasource/graphene/mesh/sharded.py
@@ -61,7 +61,7 @@ class GrapheneShardedMeshSource(GrapheneUnshardedMeshSource):
output = {}
for filepath, exists in results.items():
- label = int(os.path.basename(filepath)[:-2]) # strip :0
+ label = int(os.path.basename(filepath).split(':')[0]) # strip :0
output[label] = filepath if exists else None
return output | fixing dynamic exists (#<I>) | seung-lab_cloud-volume | train | py |
5bfa9a8e76ec0362d3694af65ef90b928066d23c | diff --git a/lib/converter.js b/lib/converter.js
index <HASH>..<HASH> 100644
--- a/lib/converter.js
+++ b/lib/converter.js
@@ -10,7 +10,7 @@ var Converter = Object.create(helpers.Createable)
Converter.init = function init (color_spaces, precision) {
this.spaces = color_spaces
- this.precision = precision || 4
+ this.precision = precision || 9
}
/**
diff --git a/lib/helpers.js b/lib/helpers.js
index <HASH>..<HASH> 100644
--- a/lib/helpers.js
+++ b/lib/helpers.js
@@ -112,7 +112,7 @@ exports.round = function (value, precision) {
exports.roundIfNumber = function roundIfNumber (value, precision) {
if (typeof value === 'number') {
- value = Number(value.toFixed(precision))
+ value = Number(value.toPrecision(precision))
}
return value
} | switched toFixed to toPrecision
also increase default precision | webdesserts_alchemist-js | train | js,js |
b12b7b045b8ab6bafec2177481ea5c6517e55df8 | diff --git a/test/constraints.js b/test/constraints.js
index <HASH>..<HASH> 100644
--- a/test/constraints.js
+++ b/test/constraints.js
@@ -55,6 +55,23 @@ describe('seraph#constraints', function() {
});
});
+ it('should not add the same constraint twice', function(done) {
+ var label = uniqn();
+ db.constraints.uniqueness.create(label, 'name', function(err, constraint) {
+ assert(!err);
+ db.constraints.uniqueness.create(label, 'name', function(err, constraint) {
+ assert(err);
+ assert(err.statusCode == 409);
+ assert(!constraint);
+ db.constraints.uniqueness.list(label, 'name', function(err, constraints) {
+ assert(!err);
+ assert(constraints.length == 1);
+ done();
+ });
+ });
+ });
+ });
+
it('should handle labels with no constraints', function(done) {
var label = uniqn();
db.constraints.uniqueness.list(label, function(err, constraints) { | constraints: add test for creating conflicting uniqueness constraints | brikteknologier_seraph | train | js |
3ecc39115b189e342c2f09cce7b53141a9dfddc2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -118,6 +118,7 @@ var isNode = function () {
var getProperties = function (err) {
var properties = {};
Object.keys(err).forEach(function (key) {
+ if (key === 'stack') return; // 'stack' seems to be enumerable in Node 0.11
var val = err[key];
switch (typeof val) {
case 'function': | Make sure 'stack' isn't added to properties in Node <I> | watson_stackman | train | js |
ca79c3684325de6128a40bfce92c9a3c4f725fbe | diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php
index <HASH>..<HASH> 100644
--- a/lib/simpletestlib.php
+++ b/lib/simpletestlib.php
@@ -538,7 +538,7 @@ class UnitTestCaseUsingDatabase extends UnitTestCase {
* have, display a rude message and clean it up for them.
*/
private function automatic_clean_up() {
- global $DB;
+ global $DB, $CFG;
$cleanmore = false;
// Drop any test tables that were created. | Unit tests MDL-<I>: Fixed error in previous UnitTestCaseDatabase change | moodle_moodle | train | php |
369e0514002876d8ec5dbafd17b0ba786f7897d3 | diff --git a/tests/example_project/tests/test_admin/helpers.py b/tests/example_project/tests/test_admin/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/example_project/tests/test_admin/helpers.py
+++ b/tests/example_project/tests/test_admin/helpers.py
@@ -12,7 +12,7 @@ class AdminTestCase(SeleniumTestCase):
super(AdminTestCase, self).__init__()
self.elements = {
'navigation' : {
- 'logout' : '//a[@href="%slogout/"]' % self.URI
+ 'logout' : '//a[contains(@href, "%slogout/")]' % self.URI
},
'pages' : {
'login' : { | Fixed logout href to work in both IE and FF | ella_django-markup | train | py |
f51d4bc2b8d01842ce3218dace6fc78ae75dac3b | diff --git a/lib/unexpected-types.js b/lib/unexpected-types.js
index <HASH>..<HASH> 100644
--- a/lib/unexpected-types.js
+++ b/lib/unexpected-types.js
@@ -82,7 +82,7 @@
if (i + j < buffer.length) {
var octet = buffer[i + j];
hexChars += (octet < 16 ? '0' : '') + octet.toString(16).toUpperCase() + ' ';
- asciiChars += (octet >= 20 && octet < 127) ? String.fromCharCode(octet) : '.';
+ asciiChars += (octet >= 32 && octet < 127) ? String.fromCharCode(octet) : '.';
} else {
hexChars += ' ';
} | Buffer inspection: Replace all control chars with '.' (confused 0x<I> with <I>). | unexpectedjs_unexpected | train | js |
35c9a4ae38ad20e0b4db8e9030c3744f2572dda7 | diff --git a/ReCaptcha.php b/ReCaptcha.php
index <HASH>..<HASH> 100644
--- a/ReCaptcha.php
+++ b/ReCaptcha.php
@@ -243,7 +243,17 @@ JS
$divOptions['class'] = "{$divOptions['class']} {$this->widgetOptions['class']}";
}
$divOptions['input-id'] = $this->getReCaptchaId();
- $divOptions['form-id'] = (isset($this->field) && $this->field->form !== null) ? $this->field->form->id : '';
+
+ if ($this->field !== null && $this->field->form !== null) {
+ if (!empty($this->field->form->options['id'])) {
+ $divOptions['form-id'] = $this->field->form->options['id'];
+ } else {
+ $divOptions['form-id'] = $this->field->form->id;
+ }
+ } else {
+ $divOptions['form-id'] = '';
+ }
+
$divOptions['id'] = $this->getReCaptchaId() . '-recaptcha' .
($divOptions['form-id'] ? ('-' . $divOptions['form-id']) : ''); | support id param in options, issue #<I> | himiklab_yii2-recaptcha-widget | train | php |
f88448516bfc303b7b021c4d8fae82d1eb5f1582 | diff --git a/src/saml2/ecp.py b/src/saml2/ecp.py
index <HASH>..<HASH> 100644
--- a/src/saml2/ecp.py
+++ b/src/saml2/ecp.py
@@ -256,29 +256,12 @@ class ECPClient(Saml2Client):
# <samlp:AuthnRequest>
# ----------------------------------------
- spentityid = self._entityid()
location = self._sso_location(entityid)
- service_url = self._service_url()
- my_name = self._my_name()
-
- if log is None:
- log = self.logger
-
- if log:
- log.info("spentityid: %s" % spentityid)
- log.info("location: %s" % location)
- log.info("service_url: %s" % service_url)
- log.info("my_name: %s" % my_name)
-
session_id = sid()
- authen_req = self.authn_request(session_id, location,
- service_url, spentityid, my_name,
- scoping, log, sign)
-
- authn_request = samlp.AuthnRequest()
+ authn_req = self.authn(location, session_id, log=log)
body = soapenv.Body()
- body.extension_elements = [element_to_extension_element(authn_request)]
+ body.extension_elements = [element_to_extension_element(authn_req)]
# ----------------------------------------
# The SOAP envelope | Made ECPClient actually produce something usable | IdentityPython_pysaml2 | train | py |
af971b6ed7b41c792e9993b95a5e4f2ac48153e9 | diff --git a/xsd/src/main/java/jlibs/xml/xsd/XMLSampleValueGenerator.java b/xsd/src/main/java/jlibs/xml/xsd/XMLSampleValueGenerator.java
index <HASH>..<HASH> 100644
--- a/xsd/src/main/java/jlibs/xml/xsd/XMLSampleValueGenerator.java
+++ b/xsd/src/main/java/jlibs/xml/xsd/XMLSampleValueGenerator.java
@@ -103,12 +103,12 @@ public class XMLSampleValueGenerator implements XSInstance.SampleValueGenerator{
@Override
public String generateSampleValue(XSElementDeclaration element, XSSimpleTypeDefinition simpleType){
List<String> values = elementValues.get(element);
- return values==null ? null : values.get(RandomUtil.random(0, values.size()));
+ return values==null ? null : values.get(RandomUtil.random(0, values.size()-1));
}
@Override
public String generateSampleValue(XSAttributeDeclaration attribute, XSSimpleTypeDefinition simpleType){
List<String> values = attributeValues.get(attribute);
- return values==null ? null : values.get(RandomUtil.random(0, values.size()));
+ return values==null ? null : values.get(RandomUtil.random(0, values.size()-1));
}
} | IndexOutOfBounds excetion in XMLSampleValueGenerator
closes Issue #<I> | santhosh-tekuri_jlibs | train | java |
dbe1d1bca20f208d8a3ba53b27ad5d22df8007c6 | diff --git a/transport_test.go b/transport_test.go
index <HASH>..<HASH> 100644
--- a/transport_test.go
+++ b/transport_test.go
@@ -2,7 +2,6 @@ package raft
import (
"bytes"
- "fmt"
"reflect"
"testing"
"time"
@@ -14,27 +13,21 @@ const (
)
func NewTestTransport(ttype int, addr string) (string, LoopbackTransport) {
- var lt LoopbackTransport
- var err error
switch ttype {
case TT_INMEM:
- addr, lt = NewInmemTransport(addr)
- if err != nil {
- panic(fmt.Sprintf("Cannot create NewInmemUnixgramTransport: %v", err))
- }
+ addr, lt := NewInmemTransport(addr)
+ return addr, lt
default:
panic("Unknown transport type")
}
- return addr, lt
}
func TestTransport_StartStop(t *testing.T) {
for ttype := 0; ttype < TT_MAX; ttype++ {
- addr, trans := NewTestTransport(ttype, "")
- if addr == "" || trans == nil {
- t.Fatalf("No address / transport returned")
+ _, trans := NewTestTransport(ttype, "")
+ if err := trans.Close(); err != nil {
+ t.Fatalf("err: %v", err)
}
- trans.Close()
}
} | Tweaks the transport test. | hashicorp_raft | train | go |
148e386c02b0a62e218489d25ed09d8d6b9344ed | diff --git a/ruby_event_store/lib/ruby_event_store/in_memory_repository.rb b/ruby_event_store/lib/ruby_event_store/in_memory_repository.rb
index <HASH>..<HASH> 100644
--- a/ruby_event_store/lib/ruby_event_store/in_memory_repository.rb
+++ b/ruby_event_store/lib/ruby_event_store/in_memory_repository.rb
@@ -63,7 +63,7 @@ module RubyEventStore
def streams_of(event_id)
streams.select do |_, stream_events|
stream_events.any? { |event| event.event_id.eql?(event_id) }
- end.map { |name, _| Stream.new(name) }
+ end.map { |name, | Stream.new(name) }
end
private | Kill mutation.
Not quite happy with this one but not a strong opinion too. | RailsEventStore_rails_event_store | train | rb |
79a5333d7e9d6deb0f1fda364f4b52232893e360 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -26,17 +26,10 @@ Account.prototype.serialize = function () {
return rlp.encode(this.raw)
}
-Account.isContract = Account.prototype.isContract = function (address) {
- var result = this.codeHash.toString('hex') !== ethUtil.SHA3_NULL.toString('hex')
- if (address) {
- result |= this.isPrecompiled(address)
- }
-
- return result
+Account.prototype.isContract = function () {
+ return this.codeHash.toString('hex') !== ethUtil.SHA3_NULL.toString('hex')
}
-Account.isPrecompiled = Account.prototype.isPrecompiled = ethUtil.isPrecompiled
-
Account.prototype.getCode = function (state, cb) {
if (this.codeHash.toString('hex') === ethUtil.SHA3_NULL.toString('hex')) {
cb(null, new Buffer([])) | Remove isPrecompiled and weird usage of isContract | ethereumjs_ethereumjs-vm | train | js |
051a828163c4428ebe45f568daaaf1bc60c31815 | diff --git a/lib/middleman-s3_sync/commands.rb b/lib/middleman-s3_sync/commands.rb
index <HASH>..<HASH> 100644
--- a/lib/middleman-s3_sync/commands.rb
+++ b/lib/middleman-s3_sync/commands.rb
@@ -32,7 +32,7 @@ module Middleman
s3_sync_options = ::Middleman::S3Sync.s3_sync_options
bucket = s3_sync_options.bucket rescue nil
- require 'pry'; binding.pry
+
unless bucket
raise Thor::Error.new "You need to activate the s3_sync extension and at least provide the bucket name."
end | Removing a stray pry invocation. | fredjean_middleman-s3_sync | train | rb |
865d893e4610b094a1dc690c217435ae25c7ae78 | diff --git a/tests/test_context.js b/tests/test_context.js
index <HASH>..<HASH> 100644
--- a/tests/test_context.js
+++ b/tests/test_context.js
@@ -32,6 +32,7 @@ exports.setup = function(svc) {
},
"Create test search": function(test) {
+ // The search created here is used by several of the following tests, specifically those using get()
var searchID = "DELETEME_JSSDK_UNITTEST";
this.service.post("search/jobs", {search: "search index=_internal | head 1", exec_mode: "blocking", id: searchID}, function(err, res) {
test.ok(res.data.sid);
@@ -667,6 +668,7 @@ exports.setup = function(svc) {
},
"Cancel test search": function(test) {
+ // Here, the search created for several of the previous tests is terminated, it is no longer necessary
var endpoint = "search/jobs/DELETEME_JSSDK_UNITTEST/control";
this.service.post(endpoint, {action: "cancel"}, function(err, res) {
test.done(); | Added comments explaning the test search | splunk_splunk-sdk-javascript | train | js |
bb2efb8f2587bac3c3f11cedd6796a7ccbfc3db2 | diff --git a/src/filter.js b/src/filter.js
index <HASH>..<HASH> 100644
--- a/src/filter.js
+++ b/src/filter.js
@@ -7,7 +7,16 @@
/*global _gpfFunc*/ // Create a new function using the source
/*#endif*/
-//region test
+/**
+ * Filtering function
+ *
+ * @callback gpf.typedef.filterFunc
+ *
+ * @param {*} data Data to filter
+ * @return {Boolean} truthy / falsy value indicating if the data matches the filter
+ *
+ * @since 0.2.4
+ */
/**
* Filter property read specification
@@ -209,8 +218,8 @@ function _gpfCreateFilterBody (specification) {
* Create a filtering function based on the given specification.
*
* @param {gpf.typedef.filterItem} specification Filter specification
- * @return {Function} Function that takes an object and return a truthy / falsy value indicating if the object
- * matches the filter
+ * @return {gpf.typedef.filterFunc} Function that takes an object and return a truthy / falsy value indicating if the
+ * object matches the filter
* @since 0.1.9
*/
gpf.createFilterFunction = function (specification) { | Documentation (#<I>) | ArnaudBuchholz_gpf-js | train | js |
3d51a2a665ba26f2161b5eb21155999b23089702 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -367,8 +367,11 @@ setup(
packages=[
"pydoop",
"pydoop.hdfs",
+ "pydoop.hdfs.hadoop",
"pydoop.app",
- "pydoop.mapreduce"
+ "pydoop.mapreduce",
+ "pydoop.utils",
+ "pydoop.utils.bridge",
],
cmdclass={
"build": BuildPydoop, | fixed setup.py, added missing submodules | crs4_pydoop | train | py |
7134a8dbba2317e3299b680bcc7f8817d3041e30 | diff --git a/gwpy/cli/cliproduct.py b/gwpy/cli/cliproduct.py
index <HASH>..<HASH> 100644
--- a/gwpy/cli/cliproduct.py
+++ b/gwpy/cli/cliproduct.py
@@ -165,7 +165,11 @@ class CliProduct(object):
"""list of channel names when at least 2 are required"""
parser.add_argument('--chan', nargs='+', action='append', required=True,
help='Two or more channels or times, first one is compared to all the others')
+ parser.add_argument('--ref',
+ help='Reference channel against which others will be compared')
+
self.arg_chan(parser)
+
return
def arg_freq(self, parser): | gwpy/cli/cliproduct.py: Add --ref option for coherence plots
Note at this time that parameter is ignored and first channel is
the reference. This kludge is to allow ldvw to have a ref parameter.
These programs will use that parameter to override the 1st channel. | gwpy_gwpy | train | py |
e8ffc008aa5d381822db03cdfef8977ca7012e86 | diff --git a/tests/test_class.py b/tests/test_class.py
index <HASH>..<HASH> 100644
--- a/tests/test_class.py
+++ b/tests/test_class.py
@@ -31,3 +31,10 @@ def test_ignore_initial_connection_failure():
current_app.config['JIRA_IGNORE_INITIAL_CONNECTION_FAILURE'] = True
jira = JIRA(current_app)
assert current_app.extensions['jira'].jira == jira
+
+
+def test_multiple():
+ assert 'jira' in current_app.extensions
+
+ with pytest.raises(ValueError):
+ JIRA(current_app) | One more test. <I>% coverage yeaaaahhh! | Robpol86_Flask-JIRA-Helper | train | py |
4976b175c0d41f9db689c36a2159b8338d55b5b1 | diff --git a/components/account.js b/components/account.js
index <HASH>..<HASH> 100644
--- a/components/account.js
+++ b/components/account.js
@@ -1,7 +1,5 @@
const BinaryKVParser = require('binarykvparser');
-const ByteBuffer = require('bytebuffer');
const StdLib = require('@doctormckay/stdlib');
-const SteamID = require('steamid');
const Helpers = require('./helpers.js');
const SteamUser = require('../index.js'); | Cleaned up imports for account.js | DoctorMcKay_node-steam-user | train | js |
ff300cd9f70f29150e0b0521de0d6832cd70afe4 | diff --git a/salt/modules/eselect.py b/salt/modules/eselect.py
index <HASH>..<HASH> 100644
--- a/salt/modules/eselect.py
+++ b/salt/modules/eselect.py
@@ -1,7 +1,7 @@
'''
-Support for eselect_, Gentoo's configuration and management tool.
-
.. _eselect: http://wiki.gentoo.org/wiki/Project:Eselect/User_guide
+
+Support for eselect_, Gentoo's configuration and management tool.
'''
# Import salt libs | Fix sphinx warning
This commit fixes a sphinx warning when building the docstring, that
complains that the link target 'eselect' is not defined. | saltstack_salt | train | py |
3061181a6109e6cf89a415d8eb51969139d3fab7 | diff --git a/fdfgen/__init__.py b/fdfgen/__init__.py
index <HASH>..<HASH> 100644
--- a/fdfgen/__init__.py
+++ b/fdfgen/__init__.py
@@ -100,7 +100,7 @@ def handle_data_names(fdf_data_names, fields_hidden, fields_readonly):
fdf_data_names = fdf_data_names.items()
for (key, value) in fdf_data_names:
- yield b''.join([b'<<\x0a/V /', smart_encode_str(value), b'\x0a/T (',
+ yield b''.join([b'<<\x0a/V /', value.encode("utf-8"), b'\x0a/T (',
smart_encode_str(key), b')\x0a',
handle_hidden(key, fields_hidden), b'\x0a',
handle_readonly(key, fields_readonly), b'\x0a>>\x0a']) | Small modification to alter the encoding of data_field keynames, to allow filling checkboxes | ccnmtl_fdfgen | train | py |
c240dc4ddf68846fb41549a9da084baa54013f14 | diff --git a/src/Validation/Traits/ValidateAsDataObjectTrait.php b/src/Validation/Traits/ValidateAsDataObjectTrait.php
index <HASH>..<HASH> 100644
--- a/src/Validation/Traits/ValidateAsDataObjectTrait.php
+++ b/src/Validation/Traits/ValidateAsDataObjectTrait.php
@@ -51,7 +51,7 @@ trait ValidateAsDataObjectTrait
$this->messages->add(
$attribute,
- $this->doReplacements(
+ $this->makeReplacements(
"Value for :attribute could not be interpreted as :friendlydataobject",
$attribute, 'dataobject', $parameters
) | Fixed validator extension for laravel <I>
doReplacements() was renamed to makeReplacements() | czim_laravel-dataobject | train | php |
Subsets and Splits