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
|
---|---|---|---|---|---|
ddfa1c801720338ed9bfa90e5b286e275ed50a40 | diff --git a/spec/karma.conf.js b/spec/karma.conf.js
index <HASH>..<HASH> 100644
--- a/spec/karma.conf.js
+++ b/spec/karma.conf.js
@@ -49,7 +49,7 @@ colors = true;
logLevel = LOG_WARN;
// enable / disable watching file and executing tests whenever any file changes
-autoWatch = true;
+autoWatch = false;
// Start these browsers, currently available:
// - Chrome
@@ -66,4 +66,4 @@ captureTimeout = 5000;
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
-// singleRun = true;
+singleRun = true; | put karma.conf back into CI mode | Leaflet_Leaflet.draw | train | js |
8f93bad77371fbc0d7dc75548472c7715eb8a2ee | diff --git a/climlab/tests/test_rcm.py b/climlab/tests/test_rcm.py
index <HASH>..<HASH> 100644
--- a/climlab/tests/test_rcm.py
+++ b/climlab/tests/test_rcm.py
@@ -19,6 +19,7 @@ def rcm():
rcm = climlab.couple([h2o,convadj,rad], name='RCM')
return rcm
[email protected]
def test_convective_adjustment(rcm):
rcm.step_forward()
# test non-scalar critical lapse rate | Mark rcm test as fast so it executes during build and test | brian-rose_climlab | train | py |
93cf9eb4f0ba302a16d46e3756fb83143a7db046 | diff --git a/stacktrace-gps.js b/stacktrace-gps.js
index <HASH>..<HASH> 100644
--- a/stacktrace-gps.js
+++ b/stacktrace-gps.js
@@ -96,7 +96,7 @@
}
function _findSourceMappingURL(source) {
- var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)$/.exec(source);
+ var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(source);
if (m && m[1]) {
return m[1];
} else { | Allow matching of sourceMappingURL lines with whitespace before the EOF | stacktracejs_stacktrace-gps | train | js |
d1aa2ad182c7cba7c6695df7f5a3b43cac303fb2 | diff --git a/command.py b/command.py
index <HASH>..<HASH> 100644
--- a/command.py
+++ b/command.py
@@ -2,8 +2,15 @@
import os
import sys
+from optparse import OptionParser
from subprocess import Popen, PIPE
+USAGE = '''usage: %prog [options] path [path...]
+
+ Checks the status of all Subversion and Mercurial repositories beneath the
+ paths given on the command line. Any repositories with uncommitted changes
+ are printed to standard out, along with the status of the files inside.'''
+
def scan(dirpath, ignore_files):
subdirs = []
@@ -69,6 +76,25 @@ def scan(dirpath, ignore_files):
for subdir in subdirs:
scan(subdir, ignore_files)
+def find_repositories_with_locate(path):
+ pass
+
+def find_repositories_by_walking(path):
+ pass
+
def main():
+ parser = OptionParser(usage=USAGE)
+ parser.add_option('-l', '--locate', dest='use_locate', action='store_true',
+ help='use locate(1) to find repositories')
+ parser.add_option('-w', '--walk', dest='use_walk', action='store_true',
+ help='manually walk file tree to find repositories')
+ (options, args) = parser.parse_args()
+
+ if not args:
+ parser.print_help()
+ exit(2)
+
for path in sys.argv[1:]:
- scan(path, set())
+ print path
+ #find_repositories(path)
+ #scan(path, set()) | Created a resonable usage message with "optparse", and started
developing an architecture where repository finding will be a separate
step (that can be accelerated with "locate") from checking their status. | brandon-rhodes_uncommitted | train | py |
2802dc2f5392729c6db4e4bc0ffb3eee1c72c6f9 | diff --git a/manager-bundle/src/HttpKernel/ContaoKernel.php b/manager-bundle/src/HttpKernel/ContaoKernel.php
index <HASH>..<HASH> 100644
--- a/manager-bundle/src/HttpKernel/ContaoKernel.php
+++ b/manager-bundle/src/HttpKernel/ContaoKernel.php
@@ -146,6 +146,10 @@ class ContaoKernel extends Kernel
if (file_exists($this->getRootDir().'/config/parameters.yml')) {
$loader->load($this->getRootDir().'/config/parameters.yml');
}
+
+ if (file_exists($this->getRootDir().'/config/security.yml')) {
+ $loader->load($this->getRootDir().'/config/security.yml');
+ }
/** @var ConfigPluginInterface[] $plugins */
$plugins = $this->getPluginLoader()->getInstancesOf(PluginLoader::CONFIG_PLUGINS); | [Manager] Support using a custom security.yml file (see #<I>). | contao_contao | train | php |
597066b8168541d0008fb1be8ba431f16cc31f68 | diff --git a/tests/mongothon/model_test.py b/tests/mongothon/model_test.py
index <HASH>..<HASH> 100644
--- a/tests/mongothon/model_test.py
+++ b/tests/mongothon/model_test.py
@@ -372,6 +372,13 @@ class TestModel(TestCase):
self.car.update_instance({"$set": {"somefield": "somevalue"}}, safe=True)
handler.assert_called_once_with(self.car, {"$set": {"somefield": "somevalue"}}, safe=True)
+ def test_did_update_event(self):
+ handler = Mock()
+ self.Car.on('did_update', handler)
+ self.car['_id'] = 'abc'
+ self.car.update_instance({"$set": {"somefield": "somevalue"}}, safe=True)
+ handler.assert_called_once_with(self.car, {"$set": {"somefield": "somevalue"}}, safe=True)
+
def test_emit_custom_event(self):
handler = Mock()
self.Car.on('fruit_explosion', handler) | Tests for did_update event | gamechanger_mongothon | train | py |
8edfd3fb5d1f11ab5e8f942134bd06f5f48d10a1 | diff --git a/imagen/ndmapping.py b/imagen/ndmapping.py
index <HASH>..<HASH> 100644
--- a/imagen/ndmapping.py
+++ b/imagen/ndmapping.py
@@ -221,6 +221,15 @@ class NdIndexableMapping(param.Parameterized):
return self.__class__(initial_items=items, **settings)
+ def empty(self):
+ """
+ Returns an empty duplicate of itself with all parameter values and
+ metadata copied across.
+ """
+ settings = dict(self.get_param_values(), **self.metadata)
+ return self.__class__(**settings)
+
+
def dframe(self, value_label='data'):
try:
import pandas | Added empty method to NdMappings
The empty method creates a new NdMapping with the same parameter values and metadata as the old mapping but without any of the data. | pyviz_imagen | train | py |
d96f2ee58e7d7947da1d4ecbe3fd88db1c4ea4bb | diff --git a/src/locales/index.js b/src/locales/index.js
index <HASH>..<HASH> 100644
--- a/src/locales/index.js
+++ b/src/locales/index.js
@@ -1,8 +1,10 @@
// Parent
import en_US from './en_US'
import ru_RU from './ru_RU'
+import zh_CN form './zh_CN'
module.exports = {
en_US,
- ru_RU
+ ru_RU,
+ zh_CN
} | fix: export zh_CN locale | transloadit_uppy | train | js |
0972c2c7379a5710e410efc583684a969db5e3b2 | diff --git a/src/utility/constraintCheck.js b/src/utility/constraintCheck.js
index <HASH>..<HASH> 100644
--- a/src/utility/constraintCheck.js
+++ b/src/utility/constraintCheck.js
@@ -2,19 +2,13 @@ const expandRuleAntecedent = require('./expandRuleAntecedent');
const Resolutor = require('../engine/Resolutor');
const Clause = require('../engine/Clause');
-module.exports = function constraintCheck(program, newFacts) {
+module.exports = function constraintCheck(program) {
let facts = [
program.getFacts(),
program.getState(),
program.getExecutedActions()
];
- if (newFacts instanceof Array) {
- facts = facts.concat(newFacts);
- } else if (newFacts !== undefined) {
- facts.push(newFacts);
- }
-
let functorProvider = program.getFunctorProvider();
let result = true; | remove newFacts from constraint check | lps-js_lps.js | train | js |
9e36932e31081391245c46f5682406e9f490edaa | diff --git a/lib/asker.js b/lib/asker.js
index <HASH>..<HASH> 100644
--- a/lib/asker.js
+++ b/lib/asker.js
@@ -427,6 +427,8 @@ Request.prototype.getUrl = function() {
*/
Request.prototype._retryHttpRequest = function(requestOptions, retryReason) {
if (this.retries >= this.options.maxRetries) {
+ contimer.stop(this, this.buildTimerId('total'));
+
// retries limit exceeded
// throw an RETRIES_LIMIT_EXCEEDED if retries allowed for request
// or retry reason error in another case | fix #<I> broken timings in the error messages on failed retries | nodules_asker | train | js |
343cfb457602a3c24a0ca8bc5b38325e25b05115 | diff --git a/src/VersionMessageControl.php b/src/VersionMessageControl.php
index <HASH>..<HASH> 100644
--- a/src/VersionMessageControl.php
+++ b/src/VersionMessageControl.php
@@ -23,9 +23,6 @@ class VersionMessageControl {
* @param string $version
*/
public function requireVersion( $version ) {
- $current_version = $this->versionDetector->detect();
- $versionRelation = version_compare( $current_version, $version );
-
if ( ! $this->isStatisfied( $version ) ) {
$this->showMessage( $this->versionDetector->getMessage() );
}
@@ -74,7 +71,7 @@ class VersionMessageControl {
/**
* Returns the configured message presenters
*
- * @return MessagePresenter
+ * @return MessagePresenter[]
*/
public function getMessagePresenters() {
return $this->messagePresenters; | Remove redundant code and add missing docs | Yoast_whip | train | php |
2e8b6e5c80d23c2d7eba462e5bd38b6118ff3925 | diff --git a/framework/web/UrlManager.php b/framework/web/UrlManager.php
index <HASH>..<HASH> 100644
--- a/framework/web/UrlManager.php
+++ b/framework/web/UrlManager.php
@@ -251,7 +251,7 @@ class UrlManager extends Component
$builtRules[] = $rule;
}
- $this->cacheBuiltRules($ruleDeclarations, $builtRules);
+ $this->setBuiltRulesCache($ruleDeclarations, $builtRules);
return $builtRules;
}
@@ -265,13 +265,13 @@ class UrlManager extends Component
* @return bool whether the value is successfully stored into cache
* @since 2.0.14
*/
- protected function cacheBuiltRules($ruleDeclarations, $builtRules)
+ protected function setBuiltRulesCache($ruleDeclarations, $builtRules)
{
if (!$this->cache instanceof CacheInterface) {
return false;
}
- return $this->cache->set([$this->cacheKey, $ruleDeclarations], $builtRules);
+ return $this->cache->set([$this->cacheKey, $this->ruleConfig, $ruleDeclarations], $builtRules);
}
/**
@@ -289,7 +289,7 @@ class UrlManager extends Component
return false;
}
- return $this->cache->get([$this->cacheKey, $ruleDeclarations]);
+ return $this->cache->get([$this->cacheKey, $this->ruleConfig, $ruleDeclarations]);
}
/** | Added ruleConfig to UrlManager::setBuiltRulesCache() to fix tests | yiisoft_yii2 | train | php |
b5c8911e70a007c75c5bf021e3c30294db467bbc | diff --git a/src/org/openscience/cdk/tools/ValencyHybridChecker.java b/src/org/openscience/cdk/tools/ValencyHybridChecker.java
index <HASH>..<HASH> 100644
--- a/src/org/openscience/cdk/tools/ValencyHybridChecker.java
+++ b/src/org/openscience/cdk/tools/ValencyHybridChecker.java
@@ -33,8 +33,6 @@ import org.openscience.cdk.config.AtomTypeFactory;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.*;
-import java.io.IOException;
-
/**
* This class is an experimental alternative to the ValencyChecker.
* The main difference is that this checker uses a different atom type
@@ -58,9 +56,9 @@ public class ValencyHybridChecker implements IValencyChecker, IDeduceBondOrderTo
protected AtomTypeFactory structgenATF;
protected LoggingTool logger;
- public ValencyHybridChecker() throws IOException, ClassNotFoundException {
+ public ValencyHybridChecker() {
this("org/openscience/cdk/config/data/hybridization_atomtypes.xml");
- }
+ }
public ValencyHybridChecker(String atomTypeList) {
this.atomTypeList = atomTypeList; | removed exceptions that were not thrown
git-svn-id: <URL> | cdk_cdk | train | java |
c21a89d457095bd6b8996ba8aaa68d49bb687928 | diff --git a/app.js b/app.js
index <HASH>..<HASH> 100755
--- a/app.js
+++ b/app.js
@@ -219,6 +219,8 @@ var ontorrent = function (torrent) {
var timePaused = 0
var pausedAt = null
+ VLC_ARGS += ' --meta-title="' + filename.replace(/"/g, '\\"') + '"'
+
if (argv.all) {
filename = engine.torrent.name
filelength = engine.torrent.length | addresses #<I> for vlc (#<I>) | mafintosh_peerflix | train | js |
ba367553f034c6769c0267905116f22064a9b7de | diff --git a/src/lib/generator.js b/src/lib/generator.js
index <HASH>..<HASH> 100644
--- a/src/lib/generator.js
+++ b/src/lib/generator.js
@@ -11,6 +11,7 @@ import generatePackage from './subgenerators/generate-swap-package/generator'
import generateGitignore from './subgenerators/generate-swap-gitignore/generator'
import generateGitattributes from './subgenerators/generate-swap-gitattributes/generator'
import generateEditorconfig from './subgenerators/generate-swap-editorconfig/generator'
+import generateNpmrc from './subgenerators/generate-swap-npmrc/generator'
import promptTask from './tasks/prompt'
@@ -35,6 +36,7 @@ export default function (app) {
app.register('gitignore', generateGitignore)
app.register('gitattributes', generateGitattributes)
app.register('editorconfig', generateEditorconfig)
+ app.register('npmrc', generateNpmrc)
/**
* Scaffold out a(n) swap-project project. Also aliased as the [default](#default) task. | register swap-npmrc as a subgenerator | sirap-group_generate-swap-project | train | js |
9d5ef9e6a3c6cd79b66f281ae95fb9b4d544fbb5 | diff --git a/helios-testing/src/main/java/com/spotify/helios/testing/HeliosConfig.java b/helios-testing/src/main/java/com/spotify/helios/testing/HeliosConfig.java
index <HASH>..<HASH> 100644
--- a/helios-testing/src/main/java/com/spotify/helios/testing/HeliosConfig.java
+++ b/helios-testing/src/main/java/com/spotify/helios/testing/HeliosConfig.java
@@ -43,16 +43,11 @@ public class HeliosConfig {
final Config baseConfig = ConfigFactory.load(
BASE_CONFIG_FILE, ConfigParseOptions.defaults(), resolveOptions);
- log.debug(component + " base config: " + baseConfig);
final Config appConfig = ConfigFactory.load(
APP_CONFIG_FILE, ConfigParseOptions.defaults(), resolveOptions);
- log.debug(component + " app config: " + appConfig);
- final Config returnConfig = appConfig.withFallback(baseConfig);
- log.debug(component + "result config: " + returnConfig);
-
- return returnConfig;
+ return appConfig.withFallback(baseConfig);
}
/** | helios-testing: remove logging of typesafe Config objects
These objects are huge, since Typesafe ends up loading all of the Java
system properties (including the classpath) in these options.
When debugging test failures from helios-testing users, these giant log
lines are just pure noise. | spotify_helios | train | java |
f08fbca835dbca8e31439ae42798f063f7a03558 | diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php
index <HASH>..<HASH> 100644
--- a/system/CLI/CLI.php
+++ b/system/CLI/CLI.php
@@ -375,12 +375,19 @@ class CLI
*/
public static function error(string $text, string $foreground = 'light_red', string $background = null)
{
+ // Check color support for STDERR
+ $stdout = static::$isColored;
+ static::$isColored = static::hasColorSupport(STDERR);
+
if ($foreground || $background)
{
$text = static::color($text, $foreground, $background);
}
fwrite(STDERR, $text . PHP_EOL);
+
+ // return STDOUT color support
+ static::$isColored = $stdout;
}
//-------------------------------------------------------------------- | Check color support for STDERR for CLI::error | codeigniter4_CodeIgniter4 | train | php |
cbcd7a739e12e80b9db7866674f0c5b2fea13f3b | diff --git a/support/cas-server-support-hazelcast-monitor/src/test/java/org/apereo/cas/monitor/HazelcastHealthIndicatorTests.java b/support/cas-server-support-hazelcast-monitor/src/test/java/org/apereo/cas/monitor/HazelcastHealthIndicatorTests.java
index <HASH>..<HASH> 100644
--- a/support/cas-server-support-hazelcast-monitor/src/test/java/org/apereo/cas/monitor/HazelcastHealthIndicatorTests.java
+++ b/support/cas-server-support-hazelcast-monitor/src/test/java/org/apereo/cas/monitor/HazelcastHealthIndicatorTests.java
@@ -39,6 +39,7 @@ import org.springframework.test.context.junit4.rules.SpringMethodRule;
import java.util.Map;
+import static org.hamcrest.Matchers.isOneOf;
import static org.junit.Assert.*;
/**
@@ -88,7 +89,8 @@ public class HazelcastHealthIndicatorTests {
@Test
public void verifyMonitor() {
val health = hazelcastHealthIndicator.health();
- assertEquals(Status.UP, health.getStatus());
+ assertThat(health.getStatus(), isOneOf(Status.UP, Status.OUT_OF_SERVICE));
+
val details = health.getDetails();
details.values().stream()
.map(Map.class::cast) | make hazelcast test less likely to fail (#<I>)
can't recreate failure locally, this change will let it get farther and
we may get more info or the test may completely pass | apereo_cas | train | java |
a2d6791cd8e8c194a08aea2462238bcc53641ddc | diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js
index <HASH>..<HASH> 100644
--- a/src/client/rest/RESTMethods.js
+++ b/src/client/rest/RESTMethods.js
@@ -68,6 +68,8 @@ class RESTMethods {
if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) {
content = escapeMarkdown(this.client.resolver.resolveString(content), true);
content = `\`\`\`${typeof code !== 'boolean' ? code || '' : ''}\n${content}\n\`\`\``;
+ split.prepend = `\`\`\`${typeof code !== 'boolean' ? code || '' : ''}\n`;
+ split.append = '\n```';
}
// Add zero-width spaces to @everyone/@here | Fix CodeBlock Splitting (#<I>)
* Fix CodeBlock Splitting
* fix changes requested | discordjs_discord.js | train | js |
20ae538b35afe01f0c1401e7b8fe30bd31f44964 | diff --git a/tiingo/__version__.py b/tiingo/__version__.py
index <HASH>..<HASH> 100644
--- a/tiingo/__version__.py
+++ b/tiingo/__version__.py
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
-__version__ = '0.5.1'
+__version__ = '0.6.0' | Bump to version <I> | hydrosquall_tiingo-python | train | py |
ac1ef729594b192931c56e1ab97d76fca7e08a24 | diff --git a/test/testutil.py b/test/testutil.py
index <HASH>..<HASH> 100644
--- a/test/testutil.py
+++ b/test/testutil.py
@@ -79,9 +79,15 @@ class KafkaIntegrationTestCase(unittest.TestCase):
self.client.close()
def current_offset(self, topic, partition):
- offsets, = self.client.send_offset_request([ OffsetRequest(kafka_bytestring(topic),
- partition, -1, 1) ])
- return offsets.offsets[0]
+ try:
+ offsets, = self.client.send_offset_request([ OffsetRequest(kafka_bytestring(topic), partition, -1, 1) ])
+ except:
+ # XXX: We've seen some UnknownErrors here and cant debug w/o server logs
+ self.zk.child.dump_logs()
+ self.server.child.dump_logs()
+ raise
+ else:
+ return offsets.offsets[0]
def msgs(self, iterable):
return [ self.msg(x) for x in iterable ] | Dump fixture logs on OffsetResponse error during producer integration
tests. This is intended to help debug an intermittent failure that
requires server logs. | dpkp_kafka-python | train | py |
d915ac6b7e81091454181df2ed8e2693c3a1ca1b | diff --git a/lib/connectController.js b/lib/connectController.js
index <HASH>..<HASH> 100644
--- a/lib/connectController.js
+++ b/lib/connectController.js
@@ -26,9 +26,9 @@ module.exports = (function () {
* If src argument is a controller instance itself
* returns a Mw with routes for each controller action.
*/
- if(src && !(src instanceof String)) {
+ if(src && !(typeof src == 'string')) {
const name = options
- ? options.name
+ ? '/' + options.name
: ''
return buildMw(src, express.Router(), name)
}
@@ -41,7 +41,7 @@ module.exports = (function () {
function loadControllersFromFolder(src) {
const folder = src ?
- src
+ path.join(process.cwd(), src)
: path.join(process.cwd(), '/controllers')
return fs | Fix connect-controller for options name and load from path | CCISEL_connect-controller | train | js |
41913fd8b9c5cf243057b7da41a1bc4e840f4f57 | diff --git a/lib/express/element-collection.js b/lib/express/element-collection.js
index <HASH>..<HASH> 100644
--- a/lib/express/element-collection.js
+++ b/lib/express/element-collection.js
@@ -126,7 +126,7 @@ ElementCollection = Collection.extend({
*/
prev: function() {
- return $([this.at(0).prev_sibling()])
+ return $([this.at(0).prevSibling()])
},
/**
@@ -137,7 +137,7 @@ ElementCollection = Collection.extend({
*/
next: function() {
- return $([this.at(0).next_sibling()])
+ return $([this.at(0).nextSibling()])
},
/** | Fixed two failures due to libxmljs update | expressjs_express | train | js |
5a61247072d8f9d4c0265917c12cbf842c9a21db | diff --git a/src/GitHub_Updater/Theme.php b/src/GitHub_Updater/Theme.php
index <HASH>..<HASH> 100644
--- a/src/GitHub_Updater/Theme.php
+++ b/src/GitHub_Updater/Theme.php
@@ -553,13 +553,13 @@ class Theme extends Base {
'upgrade-theme_' . $theme->repo
);
- $theme_update_transient = get_site_transient( 'update_themes' );
+ $current = get_site_transient( 'update_themes' );
/**
* Display theme update links.
*/
ob_start();
- if ( empty( $theme_update_transient->up_to_date[ $theme->repo ] ) ) {
+ if ( isset( $current->response[ $theme->repo ] ) ) {
?>
<p>
<strong> | renamed variable, fixed conditional
previously checking wrong part of update transient | afragen_github-updater | train | php |
7e7c53ae35271bef3e5c137a6675b186b0627cb0 | diff --git a/packages/vaex-meta/setup.py b/packages/vaex-meta/setup.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-meta/setup.py
+++ b/packages/vaex-meta/setup.py
@@ -17,7 +17,7 @@ url = 'https://www.github.com/maartenbreddels/vaex'
install_requires = [
'vaex-core>=4.0.0-alpha.6,<5',
- 'vaex-viz>=0.5.0-dev.0,<0.6',
+ 'vaex-viz>=0.5.0-dev.1,<0.6',
'vaex-server>=0.4.0-dev.0,<0.5',
'vaex-hdf5>=0.7.0-alpha.3,<0.8',
'vaex-astro>=0.8.0-dev.0,<0.9',
diff --git a/packages/vaex-viz/vaex/viz/_version.py b/packages/vaex-viz/vaex/viz/_version.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-viz/vaex/viz/_version.py
+++ b/packages/vaex-viz/vaex/viz/_version.py
@@ -1,2 +1,2 @@
-__version_tuple__ = (0, 5, 0, 'dev.0')
-__version__ = '0.5.0-dev.0'
+__version_tuple__ = (0, 5, 0, 'dev.1')
+__version__ = '0.5.0-dev.1' | Release <I>-de<I> of vaex-viz | vaexio_vaex | train | py,py |
db2342a8e7329c911b35828c35a9f913b5688235 | diff --git a/lib/imageframe.py b/lib/imageframe.py
index <HASH>..<HASH> 100644
--- a/lib/imageframe.py
+++ b/lib/imageframe.py
@@ -483,7 +483,7 @@ Keyboard Shortcuts: (For Mac OSX, replace 'Ctrl' with 'Apple')
cm_wid = 1.00
cm_ratio = 0.12
col = 'int'
- self.cmap_dat[col] = np.outer(np.ones(cmax*cm_ratio),
+ self.cmap_dat[col] = np.outer(np.ones(int(cmax*cm_ratio)),
np.linspace(0, 1, cmax))
fig = Figure((cm_wid, cm_wid*cm_ratio), dpi=150) | Adjustment to avoid warning: VisibleDeprecationWarning: using a
non-integer number instead of an integer will result in an error
in the future
a = empty(shape, dtype, order)
mkak <I> | newville_wxmplot | train | py |
141f1dacb259db3d08c274963e8a6729ec4a2f66 | diff --git a/build/controllers/ReleaseController.php b/build/controllers/ReleaseController.php
index <HASH>..<HASH> 100644
--- a/build/controllers/ReleaseController.php
+++ b/build/controllers/ReleaseController.php
@@ -318,7 +318,7 @@ class ReleaseController extends Controller
}
$this->validateWhat($what, ['framework', 'ext'], false);
- $version = reset($this->getNextVersions($this->getCurrentVersions($what), self::PATCH));
+ $version = array_values($this->getNextVersions($this->getCurrentVersions($what), self::PATCH))[0];
$this->stdout('sorting CHANGELOG of ');
$this->stdout(reset($what), Console::BOLD);
$this->stdout(" for version "); | Fix PHP notice on changelog sort command (#<I>)
```
PHP Notice 'yii\base\ErrorException' with message 'Only variables should be passed by reference'
in ../build/controllers/ReleaseController.php:<I>
``` | yiisoft_yii-core | train | php |
8432d9b692efcb5544edca51ec2a3128e1fdb734 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ setup(
},
install_requires=[
'aspy.yaml',
- 'cfgv>=1.3.0',
+ 'cfgv>=1.4.0',
'identify>=1.0.0',
# if this makes it into python3.8 move to extras_require
'importlib-metadata', | bump cfgv, forgot in last PR | pre-commit_pre-commit | train | py |
32816db82615822fb0e251f8d91378563bd8200e | diff --git a/src/main/java/com/github/sebhoss/common/annotation/package-info.java b/src/main/java/com/github/sebhoss/common/annotation/package-info.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/sebhoss/common/annotation/package-info.java
+++ b/src/main/java/com/github/sebhoss/common/annotation/package-info.java
@@ -8,4 +8,5 @@
/**
* Common code for annotations.
*/
+@NotNullByDefault
package com.github.sebhoss.common.annotation;
\ No newline at end of file | Added missing @NotNullByDefault annotation | sebhoss_common-annotations | train | java |
02b2e3dd613b17e7a52d900e44d8867501f397f0 | diff --git a/glue/LSCsegFindClient.py b/glue/LSCsegFindClient.py
index <HASH>..<HASH> 100644
--- a/glue/LSCsegFindClient.py
+++ b/glue/LSCsegFindClient.py
@@ -431,7 +431,7 @@ be present when searching for groups of segments
self.__check_gps(start)
self.__check_gps(end)
- queryList = ["02",str(start),str(end),str(interferometer),str(type)]
+ queryList = ["03",str(start),str(end),str(interferometer),str(type)]
seglist = LSCsegFindClient.segmentQueryWithMetadata(self,queryList) | Bump protocol to "<I>" for new segments.py >= revisions <I>. | gwastro_pycbc-glue | train | py |
335e205f534f7a3ac98e6b77396f886e593ceb15 | diff --git a/lib/conceptql/operators/one_in_two_out.rb b/lib/conceptql/operators/one_in_two_out.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/operators/one_in_two_out.rb
+++ b/lib/conceptql/operators/one_in_two_out.rb
@@ -18,7 +18,7 @@ twice in an outpatient setting with a 30-day gap.
category "Filter Single Stream"
basic_type :temporal
- option :inpatient_length_of_stay, type: :integer, min: 0, default: 0, desc: 'Minimum length of inpatient stay required for inpatient event to be valid'
+ option :inpatient_length_of_stay, type: :integer, min: 0, default: 0, desc: 'Minimum length of inpatient stay required for inpatient event to be valid', label: 'Inpatient Length of Stay (Days)'
option :inpatient_return_date, type: :string, options: ['Admit Date', 'Discharge Date'], default: 'Discharge Date', desc: 'Which date to pass downstream in both the start_date and end_date fields'
option :outpatient_minimum_gap, type: :string, default: '30d', desc: 'Minimum number of days between outpatient events for the event to be valid'
option :outpatient_maximum_gap, type: :string, desc: 'Maximum number of days between outpatient events for the event to be valid' | Add "(days)" to end of length of stay | outcomesinsights_conceptql | train | rb |
cf08655865450dfc5459c2c0e82815989b3b1dd0 | diff --git a/kaio/mixins/logs.py b/kaio/mixins/logs.py
index <HASH>..<HASH> 100644
--- a/kaio/mixins/logs.py
+++ b/kaio/mixins/logs.py
@@ -97,7 +97,7 @@ class LogsMixin(object):
if self.LOG_FILE:
handlers['default']['class'] = 'logging.FileHandler'
handlers['default']['filename'] = self.LOG_FILE
- handlers['default']['encoding'] = 'utf-8',
+ handlers['default']['encoding'] = 'utf-8'
handlers['mail_admins'] = {
'level': 'ERROR', | fix encoding for the handler the log file | APSL_django-kaio | train | py |
aad93e91a2ae53ef928292bf6d8b2d668156ef64 | diff --git a/udiskie/locale.py b/udiskie/locale.py
index <HASH>..<HASH> 100644
--- a/udiskie/locale.py
+++ b/udiskie/locale.py
@@ -3,10 +3,23 @@ I18n utilities.
"""
import os
+import sys
from gettext import translation
-localedir = os.environ.get('TEXTDOMAINDIR')
+testdirs = [
+ # manual override:
+ os.environ.get('TEXTDOMAINDIR'),
+ # editable installation:
+ os.path.join(os.path.dirname(__file__), '../build/locale'),
+ # user or virtualenv installation:
+ os.path.join(sys.prefix, 'share/locale'),
+]
+testfile = 'en_US/LC_MESSAGES/udiskie.mo'
+localedir = next(
+ (d for d in testdirs if d and os.path.exists(os.path.join(d, testfile))),
+ None)
+
_t = translation('udiskie', localedir, languages=None, fallback=True) | Be smarter about trying to find localedir | coldfix_udiskie | train | py |
c9e9c86fd78b405ad494f1b4590711a974db70aa | diff --git a/src/worker/AnalysisWebWorker.js b/src/worker/AnalysisWebWorker.js
index <HASH>..<HASH> 100644
--- a/src/worker/AnalysisWebWorker.js
+++ b/src/worker/AnalysisWebWorker.js
@@ -1,6 +1,7 @@
// External dependencies.
import Jed from "jed";
import { forEach, has, merge, pickBy, includes, isNull, isUndefined, isString, isObject } from "lodash-es";
+import { autop } from '@wordpress/autop';
// YoastSEO.js dependencies.
import * as assessments from "../assessments";
@@ -647,6 +648,8 @@ export default class AnalysisWebWorker {
* @returns {Object} The result, may not contain readability or seo.
*/
analyze( id, { paper, relatedKeywords = {} } ) {
+ // Automatically add paragraph tags, like Wordpress does, on double newline padded blocks.
+ paper._text = autop( paper._text );
paper._text = string.removeHtmlBlocks( paper._text );
const paperHasChanges = this._paper === null || ! this._paper.equals( paper );
const shouldReadabilityUpdate = this.shouldReadabilityUpdate( paper ); | Added call to autop in analyzer to automatically add p-tags the way wordpress does. | Yoast_YoastSEO.js | train | js |
a5fd6f86deedb1fa510a13178d605d6fa2e6e2ff | diff --git a/tools/kill-mxnet.py b/tools/kill-mxnet.py
index <HASH>..<HASH> 100644
--- a/tools/kill-mxnet.py
+++ b/tools/kill-mxnet.py
@@ -25,12 +25,12 @@ with open(host_file, "r") as f:
for host in f:
if ':' in host:
host = host[:host.index(':')]
- print host
- subprocess.Popen(["ssh", "%s" % host, kill_cmd],
- shell=False,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- print "Done killing"
+ print host
+ subprocess.Popen(["ssh", "-oStrictHostKeyChecking=no", "%s" % host, kill_cmd],
+ shell=False,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ print "Done killing"
# Kill program on local machine
os.system(kill_cmd) | Debug kill-mxnet.py command can't kill remote processes (#<I>) | apache_incubator-mxnet | train | py |
69450b6c280144bc04217ff3c11ee5b4718096db | diff --git a/lxd/storage/drivers/load.go b/lxd/storage/drivers/load.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/drivers/load.go
+++ b/lxd/storage/drivers/load.go
@@ -30,11 +30,11 @@ func Load(state *state.State, driverName string, name string, config map[string]
}
// SupportedDrivers returns a list of supported storage drivers.
-func SupportedDrivers() []Info {
+func SupportedDrivers(s *state.State) []Info {
supportedDrivers := []Info{}
for driverName := range drivers {
- driver, err := Load(nil, driverName, "", nil, nil, nil, nil)
+ driver, err := Load(s, driverName, "", nil, nil, nil, nil)
if err != nil {
continue
} | lxd/storage: Pass state to SupportedDrivers | lxc_lxd | train | go |
998915f7ea61131e55a7b53c7361892021b5b535 | diff --git a/lib/jdoc/link.rb b/lib/jdoc/link.rb
index <HASH>..<HASH> 100644
--- a/lib/jdoc/link.rb
+++ b/lib/jdoc/link.rb
@@ -145,7 +145,7 @@ module Jdoc
# @return [true, false] True if this endpoint must have request body
def has_request_body?
- ["PATCH", "POST", "PUT"].include?(method)
+ ["PATCH", "POST", "PUT"].include?(method) && !request_parameters.empty?
end
# We have a policy that we should not return response body to PUT and DELETE requests. | Treat empty request properties as no request body | r7kamura_jdoc | train | rb |
e75e5057a2ed8705a5981aef3cd6fdcacc0e23bf | diff --git a/lib/ProMotion/screen/_table_screen_module.rb b/lib/ProMotion/screen/_table_screen_module.rb
index <HASH>..<HASH> 100644
--- a/lib/ProMotion/screen/_table_screen_module.rb
+++ b/lib/ProMotion/screen/_table_screen_module.rb
@@ -36,6 +36,7 @@ module ProMotion
end
end
def self.included(base)
+ base.extend(ClassMethods)
base.extend(TableClassMethods)
end
end | Fixing inclusion issue for tablescreens | infinitered_ProMotion | train | rb |
10bd017b8c8054642035016499eee21c1bbf7881 | diff --git a/js/kucoinfutures.js b/js/kucoinfutures.js
index <HASH>..<HASH> 100644
--- a/js/kucoinfutures.js
+++ b/js/kucoinfutures.js
@@ -1230,7 +1230,7 @@ module.exports = class kucoinfutures extends kucoin {
};
}
- async parseBalance (response) {
+ async parseBalance (response, params) {
const result = {
'info': response,
'timestamp': undefined, | Add params in kucoinFutures | ccxt_ccxt | train | js |
3bc13407d86c1efbfd9842137c2c9c43f4983ce8 | diff --git a/documentcloud/__init__.py b/documentcloud/__init__.py
index <HASH>..<HASH> 100644
--- a/documentcloud/__init__.py
+++ b/documentcloud/__init__.py
@@ -745,7 +745,7 @@ resource on public documents."
"""
template = self.resources.page.get('text')
url = template.replace("{page}", str(page))
- return self._get_url(url)
+ return url
def get_page_text(self, page):
"""
diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -237,6 +237,17 @@ class DocumentTest(BaseTest):
# for all the old documents in the database.
#self.assertEqual(hashlib.sha1(pdf).hexdigest(), obj.file_hash)
+ # Text
+ self.assertEqual(
+ obj.get_page_text_url(1),
+ 'https://www.documentcloud.org/documents/74103/pages/\
+report-of-the-calpers-special-review-p1.txt'
+ )
+ self.assertEqual(
+ document.get_page_text(1).split("\n")[0].strip(),
+ "Report of the CalPERS Special Review"
+ )
+
# Images
self.assertTrue(len(obj.small_image) > 0)
self.assertTrue(len(obj.thumbnail_image) > 0) | Attempt at patching the get_page_text bug identified by @aboutaaron in #<I>. Also added a unittest to make sure it's working in the future. | datadesk_python-documentcloud | train | py,py |
e735afc3fdf1d04256ba3efa2fd860bcf901afd8 | diff --git a/spec/internal/app/controllers/nestive_controller.rb b/spec/internal/app/controllers/nestive_controller.rb
index <HASH>..<HASH> 100644
--- a/spec/internal/app/controllers/nestive_controller.rb
+++ b/spec/internal/app/controllers/nestive_controller.rb
@@ -1,9 +1,9 @@
class NestiveController < ApplicationController
def extended_one
- render layout: 'extend_one'
+ render :layout => 'extend_one'
end
def extended_two
- render layout: 'extend_two'
+ render :layout => 'extend_two'
end
end
\ No newline at end of file | convert hashes for compat with <I>, ref #2 | rwz_nestive | train | rb |
134d33400eeea12265c3e86c8ac9d06dfc58d261 | diff --git a/great_expectations/dataset/util.py b/great_expectations/dataset/util.py
index <HASH>..<HASH> 100644
--- a/great_expectations/dataset/util.py
+++ b/great_expectations/dataset/util.py
@@ -110,10 +110,7 @@ def ensure_json_serializable(test_dict):
#test_dict[key] = test_dict[key].tolist()
## If we have an array or index, convert it first to a list--causing coercion to float--and then round
## to the number of digits for which the string representation will equal the float representation
- test_dict[key] = map(
- lambda x: round(x, sys.float_info.dig),
- test_dict[key].tolist()
- )
+ test_dict[key] = [round(x, sys.float_info.dig) for x in test_dict[key].tolist()]
elif isinstance(test_dict[key], dict): | Improve python3 compatibility with list comprehension instead of map | great-expectations_great_expectations | train | py |
0d9550cef8ff8263f8351f9b9b289d0e83ac83d5 | diff --git a/lib/silo/repository.rb b/lib/silo/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/silo/repository.rb
+++ b/lib/silo/repository.rb
@@ -164,9 +164,9 @@ module Silo
# @yield [path] The code inside this block will be executed with
# +$GIT_WORK_TREE+ set
# @yieldparam [String] path The absolute path used for +$GIT_WORK_TREE+
- def in_work_tree(path = '.')
+ def in_work_tree(path)
tmp_dir = path == :tmp
- path = tmp_dir ? Dir.mktmpdir : File.expand_path(path)
+ path = Dir.mktmpdir if tmp_dir
old_work_tree = ENV['GIT_WORK_TREE']
ENV['GIT_WORK_TREE'] = path
Dir.chdir(path) { yield path } | Removed duplicate path expansion in Repository#in_work_tree | koraktor_silo | train | rb |
ca2bb9ae3ac13a81c5280fa8487952a6ab3f4251 | diff --git a/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/applications/InstallAppsMojo.java b/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/applications/InstallAppsMojo.java
index <HASH>..<HASH> 100644
--- a/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/applications/InstallAppsMojo.java
+++ b/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/applications/InstallAppsMojo.java
@@ -215,11 +215,17 @@ public class InstallAppsMojo extends InstallAppMojoSupport {
boolean supported = false;
switch (type) {
case "ear":
- case "war":
case "rar":
case "eba":
case "esa":
case "liberty-assembly":
+ if(installThinProject) {
+ log.warn("thin-project cannot be configured for installAppPackages for the " + type + " packaging type");
+ } else {
+ supported = true;
+ }
+ break;
+ case "war":
supported = true;
break;
case "jar": | Log a warning if the packaging type does not support the thin-project configuration | WASdev_ci.maven | train | java |
48617c37487c5ad503774a35990ff87731fad374 | diff --git a/test/misc/attribute_params_test.rb b/test/misc/attribute_params_test.rb
index <HASH>..<HASH> 100644
--- a/test/misc/attribute_params_test.rb
+++ b/test/misc/attribute_params_test.rb
@@ -45,7 +45,7 @@ class AttributeParamsTest < MiniTest::Test
assert_equal 'First', model.first_name
assert_nil model.last_name
assert_equal buildings.map(&:id), model.building_ids
- assert_equal buildings, model.buildings
+ assert_equal buildings.map(&:id), model.buildings.map(&:id)
assert model.save
assert_equal 2, model.reload.buildings_count
diff --git a/test/misc/tableless_test.rb b/test/misc/tableless_test.rb
index <HASH>..<HASH> 100644
--- a/test/misc/tableless_test.rb
+++ b/test/misc/tableless_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class TablelessTest < MiniTest::Test
def test_find_all
- assert_equal [], FileModel.all
+ assert FileModel.all.to_a.empty?
end
def test_find_by_id
@@ -12,7 +12,7 @@ class TablelessTest < MiniTest::Test
end
def test_find_with_association
- assert_equal [], Person.new.files
+ assert Person.new.files.empty?
end
end | fix rubinius tests with rails <I> | activescaffold_active_scaffold | train | rb,rb |
18dff1ca070995dffae98a532c18aeda70a270de | diff --git a/tests/testapp/models.py b/tests/testapp/models.py
index <HASH>..<HASH> 100644
--- a/tests/testapp/models.py
+++ b/tests/testapp/models.py
@@ -2,9 +2,9 @@
Model relationship:
- Author
- ||
- ||
+ Author auth.User
+ || |
+ || @
||-----@ Post ----> PostWithPicture
| ______/
| |
diff --git a/tests/testapp/resources.py b/tests/testapp/resources.py
index <HASH>..<HASH> 100644
--- a/tests/testapp/resources.py
+++ b/tests/testapp/resources.py
@@ -1,3 +1,4 @@
+from django.conf import settings
from jsonapi.resource import Resource
from jsonapi.api import API
@@ -5,6 +6,12 @@ api = API()
@api.register
+class UserResource(Resource):
+ class Meta:
+ model = settings.AUTH_USER_MODEL
+
+
[email protected]
class AuthorResource(Resource):
class Meta:
model = 'testapp.Author' | add resource for User (authenticated model) | pavlov99_jsonapi | train | py,py |
97a9b915315b2922193b9e75ed1fc37219783b2e | diff --git a/src/java/com/threerings/media/sprite/Sprite.java b/src/java/com/threerings/media/sprite/Sprite.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/media/sprite/Sprite.java
+++ b/src/java/com/threerings/media/sprite/Sprite.java
@@ -1,5 +1,5 @@
//
-// $Id: Sprite.java,v 1.64 2003/04/30 00:44:36 mdb Exp $
+// $Id: Sprite.java,v 1.65 2003/11/24 21:58:36 mdb Exp $
package com.threerings.media.sprite;
@@ -347,6 +347,13 @@ public abstract class Sprite extends AbstractMedia
}
// documentation inherited
+ public void shutdown ()
+ {
+ super.shutdown();
+ cancelMove(); // cancel any active path
+ }
+
+ // documentation inherited
protected void toString (StringBuffer buf)
{
super.toString(buf); | Cancel any path on a sprite if it's removed while in the middle of
execution.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
d7c3e49530e33eec4c7a79983a39fd08b35f1eda | diff --git a/toml.py b/toml.py
index <HASH>..<HASH> 100644
--- a/toml.py
+++ b/toml.py
@@ -232,7 +232,8 @@ def loads(s, _dict=dict):
multilinestr = ""
multibackslash = False
for line in s:
- line = line.strip()
+ if not multilinestr:
+ line = line.strip()
if line == "":
continue
if multikey: | Do not strip() line if its part of multiline str
Fixes #<I> | uiri_toml | train | py |
45aab2373c84948ca5b9474d61a12e093a37ac28 | diff --git a/lib/graphql/union_type.rb b/lib/graphql/union_type.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/union_type.rb
+++ b/lib/graphql/union_type.rb
@@ -24,8 +24,15 @@ module GraphQL
# }
#
class UnionType < GraphQL::BaseType
+ # Rubocop was unhappy about the syntax when this was a proc literal
+ class AcceptPossibleTypesDefinition
+ def self.call(target, possible_types, options = {})
+ target.add_possible_types(possible_types, **options)
+ end
+ end
+
accepts_definitions :resolve_type, :type_membership_class,
- possible_types: ->(target, possible_types, options = {}) { target.add_possible_types(possible_types, **options) }
+ possible_types: AcceptPossibleTypesDefinition
ensure_defined :possible_types, :resolve_type, :resolve_type_proc, :type_membership_class
attr_accessor :resolve_type_proc | Work around rubocop parser issue | rmosolgo_graphql-ruby | train | rb |
f631c9aae22b6cfd966719d488b9086ce46d6351 | diff --git a/src/Basset/BassetServiceProvider.php b/src/Basset/BassetServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Basset/BassetServiceProvider.php
+++ b/src/Basset/BassetServiceProvider.php
@@ -49,7 +49,7 @@ class BassetServiceProvider extends ServiceProvider {
// Tell the logger to use a rotating files setup to log problems encountered during
// Bassets operation but only when debugging is enabled.
if ($this->app['config']->get('basset.debug', false)) {
- $this->app['basset.log']->useDailyFiles($this->app['path.storage'].'/basset.txt', 0, 'warning');
+ $this->app['basset.log']->useDailyFiles($this->app['path.storage'].'/logs/basset.log', 0, 'warning');
}
// If debugging is disabled we'll use a null handler to essentially send all logged | Moved log files to `storage/logs` instead of just `storage` | Marwelln_basset | train | php |
c105c742edbe3ce90ff6db8929631d81f368e2af | diff --git a/src/Gaufrette/Adapter/OpenCloud.php b/src/Gaufrette/Adapter/OpenCloud.php
index <HASH>..<HASH> 100644
--- a/src/Gaufrette/Adapter/OpenCloud.php
+++ b/src/Gaufrette/Adapter/OpenCloud.php
@@ -118,7 +118,7 @@ class OpenCloud implements Adapter,
public function exists($key)
{
$this->initialize();
- return intval($this->tryGetObject($key)->content_length) > 0;
+ return ($this->tryGetObject($key) !== false);
}
/** | Update OpenCloud.php
Changed exists check condition | KnpLabs_Gaufrette | train | php |
b65a0553b903c8db1bf8b9661824d202cda6f04c | diff --git a/public/js/render/live.js b/public/js/render/live.js
index <HASH>..<HASH> 100644
--- a/public/js/render/live.js
+++ b/public/js/render/live.js
@@ -323,7 +323,7 @@ var renderLivePreview = (function () {
if (!$live.find('iframe').length) {
iframe = document.createElement('iframe');
iframe.setAttribute('class', 'stretch');
- iframe.setAttribute('sandbox', 'allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts');
+ iframe.setAttribute('sandbox', 'allow-modals allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts');
iframe.setAttribute('frameBorder', '0');
iframe.setAttribute('name', '<proxy>');
$live.prepend(iframe); | fix: allow alerts in the iframe again
Fixes #<I>
Props to @mikewest ❤ | jsbin_jsbin | train | js |
37c998479732411082de99d476d738e5ec545d7e | diff --git a/src/main/java/ixa/kaflib/IdManager.java b/src/main/java/ixa/kaflib/IdManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/ixa/kaflib/IdManager.java
+++ b/src/main/java/ixa/kaflib/IdManager.java
@@ -11,7 +11,7 @@ class IdManager implements Serializable {
/* Prefix of each type of ids */
private static final String WF_PREFIX = "w";
private static final String TERM_PREFIX = "t";
- private static final String MARK_PREFIX = "s";
+ private static final String MARK_PREFIX = "m";
private static final String MW_PREFIX = "t.mw";
private static final String COMPONENT_PREFIX = ".";
private static final String CHUNK_PREFIX = "c"; | Mark identifiers start with "m" | ixa-ehu_kaflib | train | java |
186e7a12e86fffa78e773c2b45aba4d8e5177fd2 | diff --git a/Goutte/Tests/ClientTest.php b/Goutte/Tests/ClientTest.php
index <HASH>..<HASH> 100644
--- a/Goutte/Tests/ClientTest.php
+++ b/Goutte/Tests/ClientTest.php
@@ -122,6 +122,25 @@ class ClientTest extends \PHPUnit_Framework_TestCase
), $request->getPostFiles());
}
+ public function testUsesPostNamedFiles()
+ {
+ $guzzle = $this->getGuzzle();
+ $client = new Client();
+ $client->setClient($guzzle);
+ $files = array(
+ 'test' => __FILE__
+ );
+
+ $crawler = $client->request('POST', 'http://www.example.com/', array(), $files);
+ $request = $this->historyPlugin->getLastRequest();
+
+ $this->assertEquals(array(
+ 'test' => array(
+ new PostFile('test', __FILE__, 'text/x-php')
+ )
+ ), $request->getPostFiles());
+ }
+
public function testUsesPostFilesNestedFields()
{
$guzzle = $this->getGuzzle(); | Adding unit test for a file upload using a specific file name/path rather than a file array with tmp_name. | FriendsOfPHP_Goutte | train | php |
07926a86c97e2946122930c2614e6fa7655a3e93 | diff --git a/go/vt/primecache/primecache.go b/go/vt/primecache/primecache.go
index <HASH>..<HASH> 100644
--- a/go/vt/primecache/primecache.go
+++ b/go/vt/primecache/primecache.go
@@ -277,9 +277,9 @@ func (pc *PrimeCache) OneRun() {
return
}
if slavestat.secondsBehindMaster < 2 {
- log.Infof("Slave lag is negligible - %v seconds", slavestat.secondsBehindMaster)
return
}
+ log.Infof("Replication lag is high (%v seconds), activating", slavestat.secondsBehindMaster)
// setup the connections to the db to apply the statements
if err := pc.setupPrimerConnections(); err != nil { | Fixing a log that's too verbose. | vitessio_vitess | train | go |
f44fd37238526d77f2f93b574487c3ba1b982b31 | diff --git a/aggregation-db/src/main/java/io/datakernel/aggregation_db/Aggregation.java b/aggregation-db/src/main/java/io/datakernel/aggregation_db/Aggregation.java
index <HASH>..<HASH> 100644
--- a/aggregation-db/src/main/java/io/datakernel/aggregation_db/Aggregation.java
+++ b/aggregation-db/src/main/java/io/datakernel/aggregation_db/Aggregation.java
@@ -341,7 +341,7 @@ public class Aggregation {
if (sortingRequired(resultKeys, getKeys())) {
Comparator keyComparator = structure.createKeyComparator(outputClass, resultKeys);
Path path = Paths.get("sorterStorage", "%d.part");
- BufferSerializer bufferSerializer = structure.createBufferSerializer(outputClass, getKeys(), aggregationFields);
+ BufferSerializer bufferSerializer = structure.createBufferSerializer(outputClass, resultKeys, aggregationFields);
StreamMergeSorterStorage sorterStorage = new StreamMergeSorterStorageImpl(eventloop, executorService,
bufferSerializer, path, sorterBlockSize);
StreamSorter sorter = new StreamSorter(eventloop, sorterStorage, Functions.identity(), keyComparator, false, | Fix sorting during query execution in aggregation-db | softindex_datakernel | train | java |
290935d4bdf011ab4cace0ffe758ef8000d66b0b | diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php
index <HASH>..<HASH> 100644
--- a/Auth/OpenID/Consumer.php
+++ b/Auth/OpenID/Consumer.php
@@ -1295,7 +1295,7 @@ class Auth_OpenID_GenericConsumer {
$resp = $this->fetcher->post($server_url, $body);
if ($resp === null) {
- return Auth_OpenID_ServerErrorContainer::fromMessage('');
+ return null;
}
$response_message = Auth_OpenID_Message::fromKVForm($resp->body); | [project @ prevent error 'call to member function of a non-object'] | openid_php-openid | train | php |
e2af07df446850483fd9f3c1edd0a7340d3510a8 | diff --git a/moto/core/responses.py b/moto/core/responses.py
index <HASH>..<HASH> 100644
--- a/moto/core/responses.py
+++ b/moto/core/responses.py
@@ -20,7 +20,6 @@ import six
from six.moves.urllib.parse import parse_qs, urlparse
import xmltodict
-from pkg_resources import resource_filename
from werkzeug.exceptions import HTTPException
import boto3
@@ -766,6 +765,9 @@ class AWSServiceSpec(object):
"""
def __init__(self, path):
+ # Importing pkg_resources takes ~60ms; keep it local
+ from pkg_resources import resource_filename # noqa
+
self.path = resource_filename("botocore", path)
with io.open(self.path, "r", encoding="utf-8") as f:
spec = json.load(f) | Keep pkg_resources import function-local (~<I>s) | spulec_moto | train | py |
931a4578da5b7d0866183df58c6fdf520f351646 | diff --git a/sqlg-core/src/main/java/org/umlg/sqlg/util/SqlgUtil.java b/sqlg-core/src/main/java/org/umlg/sqlg/util/SqlgUtil.java
index <HASH>..<HASH> 100644
--- a/sqlg-core/src/main/java/org/umlg/sqlg/util/SqlgUtil.java
+++ b/sqlg-core/src/main/java/org/umlg/sqlg/util/SqlgUtil.java
@@ -883,6 +883,7 @@ public class SqlgUtil {
if (rs.next()) {
try (Statement s = conn.createStatement()) {
s.execute("REVOKE ALL PRIVILEGES ON SCHEMA public FROM \"sqlgReadOnly\"");
+ s.execute("REVOKE ALL PRIVILEGES ON SCHEMA \"sqlg_schema\" FROM \"sqlgReadOnly\"");
s.execute("DROP ROLE \"sqlgReadOnly\"");
} catch (SQLException e) {
throw new RuntimeException(e); | revoke readonly privileges from sqlg_schema | pietermartin_sqlg | train | java |
4b25c1504bbe0ebf5f61fb2a04dbf686cabf2712 | diff --git a/src/Google/Service/Resource.php b/src/Google/Service/Resource.php
index <HASH>..<HASH> 100644
--- a/src/Google/Service/Resource.php
+++ b/src/Google/Service/Resource.php
@@ -115,6 +115,9 @@ class Google_Service_Resource
$this->convertToArrayAndStripNulls($parameters['postBody']);
}
$postBody = json_encode($parameters['postBody']);
+ if ($postBody === false && $parameters['postBody'] !== false) {
+ throw new Google_Exception("JSON encoding failed. Ensure all strings in the request are UTF-8 encoded.");
+ }
unset($parameters['postBody']);
} | Fail fast if JSON encoding fails
Let the `call` method fail fast in case `json_encode` fails to encode the request body, rather than proceeding with invalid data. | googleapis_google-api-php-client | train | php |
5fe304a65fbd8837bc905d710809f8e264750dd1 | diff --git a/lib/flint.js b/lib/flint.js
index <HASH>..<HASH> 100644
--- a/lib/flint.js
+++ b/lib/flint.js
@@ -1648,10 +1648,15 @@ Flint.prototype.spawn = function(roomId) {
.then(room => {
// if team
if(typeof room.teamId !== 'undefined') {
- newBot.isTeam = true;
return this.getTeam(room.teamId)
.then(team => {
newBot.team = team;
+ newBot.isTeam = true;
+ return when(room);
+ })
+ .catch(err => {
+ newBot.team = {};
+ newBot.isTeam = false;
return when(room);
});
} else { | Does not tag bot as team and ends spawn process when getTeam() call returns <I> | flint-bot_flint | train | js |
95dd8fc3d518e2177f3a206568ea45a8b1fb8a7c | diff --git a/src/Drupal/DrupalExtension/Context/DrupalContext.php b/src/Drupal/DrupalExtension/Context/DrupalContext.php
index <HASH>..<HASH> 100644
--- a/src/Drupal/DrupalExtension/Context/DrupalContext.php
+++ b/src/Drupal/DrupalExtension/Context/DrupalContext.php
@@ -366,6 +366,7 @@ class DrupalContext extends MinkContext implements DrupalAwareInterface {
* Find a heading in a specific region.
*
* @Then /^I should see the heading "(?P<heading>[^"]*)" in the "(?P<region>[^"]*)"(?:| region)$/
+ * @Then /^I should see the "(?P<heading>[^"]*)" heading in the "(?P<region>[^"]*)"(?:| region)$/
*/
public function iShouldSeeTheHeadingInTheRegion($heading, $region) {
$page = $this->getSession()->getPage(); | Adding additional feature language around finding headings in regions. | jhedstrom_drupalextension | train | php |
fa23fc4a00e0946bc9e66fa927d29e79acc054ca | diff --git a/packages/react-admin/src/mui/button/SaveButton.js b/packages/react-admin/src/mui/button/SaveButton.js
index <HASH>..<HASH> 100644
--- a/packages/react-admin/src/mui/button/SaveButton.js
+++ b/packages/react-admin/src/mui/button/SaveButton.js
@@ -33,6 +33,7 @@ const sanitizeRestProps = ({
submitOnEnter,
redirect,
locale,
+ showNotification,
...rest
}) => rest; | Sanitize ShowNotification prop in SaveButton | marmelab_react-admin | train | js |
f5adc144282eb8fe46d2caab902d1eb85fd5d4b1 | diff --git a/angr/project.py b/angr/project.py
index <HASH>..<HASH> 100644
--- a/angr/project.py
+++ b/angr/project.py
@@ -199,6 +199,8 @@ class Project(object):
# Step 5: determine the guest OS
if isinstance(simos, type) and issubclass(simos, SimOS):
self.simos = simos(self) #pylint:disable=invalid-name
+ elif isinstance(simos, str):
+ self.simos = os_mapping[simos](self)
elif simos is None:
self.simos = os_mapping[self.loader.main_object.os](self)
else: | You can specify the simos as a string in the project constructor | angr_angr | train | py |
f3aebf28c1425dbdf661f42ebe96b355c4fe90dc | diff --git a/src/main/java/com/aoapps/messaging/http/HttpSocketContext.java b/src/main/java/com/aoapps/messaging/http/HttpSocketContext.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/aoapps/messaging/http/HttpSocketContext.java
+++ b/src/main/java/com/aoapps/messaging/http/HttpSocketContext.java
@@ -34,7 +34,7 @@ public abstract class HttpSocketContext extends AbstractSocketContext<HttpSocket
protected final DocumentBuilderFactory builderFactory;
- public HttpSocketContext() {
+ protected HttpSocketContext() {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); | protected constructor is sufficient for abstract class | aoindustries_ao-messaging-http | train | java |
e7bb87b77993c2bed841f5a6d436a7fd5e68743e | diff --git a/server/webapp/WEB-INF/rails.new/config/routes.rb b/server/webapp/WEB-INF/rails.new/config/routes.rb
index <HASH>..<HASH> 100644
--- a/server/webapp/WEB-INF/rails.new/config/routes.rb
+++ b/server/webapp/WEB-INF/rails.new/config/routes.rb
@@ -218,7 +218,7 @@ Go::Application.routes.draw do
scope :api, as: :apiv1, format: false do
api_version(:module => 'ApiV1', header: {name: 'Accept', value: 'application/vnd.go.cd.v1+json'}) do
- resources :backups, only: [:create]
+ resources :backups, only: [:create], constraints: HeaderConstraint.new
resources :users, param: :login_name, only: [:create, :index, :show, :destroy], constraints: {login_name: /(.*?)/} do
patch :update, on: :member | Added custom header for backups api (#<I>) | gocd_gocd | train | rb |
63b5318e864d4ed18ef7efec2ade567a1bbba0ee | diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php
index <HASH>..<HASH> 100644
--- a/admin/settings/plugins.php
+++ b/admin/settings/plugins.php
@@ -372,13 +372,12 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
// Question type settings.
$ADMIN->add('modules', new admin_category('qtypesettings', get_string('questiontypes', 'admin')));
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
- require_once($CFG->libdir . '/questionlib.php');
- global $QTYPES;
- foreach ($QTYPES as $qtype) {
- $settingsfile = $qtype->plugin_dir() . '/settings.php';
+ $qtypes = get_plugin_list('qtype');
+ foreach ($qtypes as $qtype => $path) {
+ $settingsfile = $path . '/settings.php';
if (file_exists($settingsfile)) {
- $settings = new admin_settingpage('qtypesetting' . $qtype->name(),
- $qtype->local_name(), 'moodle/question:config');
+ $settings = new admin_settingpage('qtypesetting' . $qtype,
+ get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config');
include($settingsfile);
if ($settings) {
$ADMIN->add('qtypesettings', $settings); | qtype admin MDL-<I> use get_plugin_list, rather than including questionlib.php.
This should be a small be significant performance win for people who are logged in as admin. | moodle_moodle | train | php |
1421c3c610cbb0eb873e891c62c6107111cc768d | diff --git a/Fields/DateField.php b/Fields/DateField.php
index <HASH>..<HASH> 100644
--- a/Fields/DateField.php
+++ b/Fields/DateField.php
@@ -12,12 +12,12 @@ class DateField extends Field
/**
* Push save
*/
- private $pushSave = array();
+ protected $pushSave = array();
/**
* Sub-field
*/
- private $fields;
+ protected $fields;
public function __sleep()
{
@@ -81,7 +81,7 @@ class DateField extends Field
}
}
- private function generate()
+ protected function generate()
{
$this->fields = array();
@@ -90,7 +90,7 @@ class DateField extends Field
$this->fields[] = $this->createSelect('year', range(date('Y')-120, date('Y')));
}
- private function createSelect($name, $options)
+ protected function createSelect($name, $options)
{
$select = new Select;
$select->setLanguage($this->language);
@@ -106,7 +106,7 @@ class DateField extends Field
return $select;
}
- private function buildOptions(&$select, $range)
+ protected function buildOptions(&$select, $range)
{
foreach ($range as $value) {
$option = new Option;
@@ -116,7 +116,7 @@ class DateField extends Field
}
}
- private function proxyPush($target)
+ protected function proxyPush($target)
{
foreach ($this->pushSave as $var => $value) {
$target->push($var, $value); | private -> protected in DateField | Gregwar_Formidable | train | php |
58b58a79bf411e9ad1367fb2eb3eaa2ee90d488e | diff --git a/auto_ml/predictor.py b/auto_ml/predictor.py
index <HASH>..<HASH> 100644
--- a/auto_ml/predictor.py
+++ b/auto_ml/predictor.py
@@ -277,6 +277,16 @@ class Predictor(object):
self.add_cluster_prediction = add_cluster_prediction
self.num_weak_estimators = num_weak_estimators
+ # Put in place the markers that will tell us later on to train up a subpredictor for this problem
+ if self.num_weak_estimators > 0:
+ for idx in range(self.num_weak_estimators):
+ self.column_descriptions['weak_estimator_' + str(idx)] = self.type_of_estimator
+ self.subpredictors.append('weak_estimator_' + str(idx))
+ self.weak_estimator_store = {
+ 'regressor': ['LinearRegression', 'Ridge'],
+ 'classifier': ['LogisticRegression', 'RidgeClassifier']
+ }
+
if verbose:
print('Welcome to auto_ml! We\'re about to go through and make sense of your data using machine learning') | creates structure we will use to know how many subpredictors to train up from num_weak_estimators | ClimbsRocks_auto_ml | train | py |
abf251212c20e8b70cf6e23b2249c86eb07b3f41 | diff --git a/core/server/api/authentication.js b/core/server/api/authentication.js
index <HASH>..<HASH> 100644
--- a/core/server/api/authentication.js
+++ b/core/server/api/authentication.js
@@ -65,11 +65,6 @@ authentication = {
}).then(function () {
return when.resolve({passwordreset: [{message: 'Check your email for further instructions.'}]});
}).otherwise(function (error) {
- // TODO: This is kind of sketchy, depends on magic string error.message from Bookshelf.
- if (error && error.message === 'NotFound') {
- error = new errors.UnauthorizedError('Invalid email address');
- }
-
return when.reject(error);
});
});
diff --git a/core/server/models/user.js b/core/server/models/user.js
index <HASH>..<HASH> 100644
--- a/core/server/models/user.js
+++ b/core/server/models/user.js
@@ -631,7 +631,7 @@ User = ghostBookshelf.Model.extend({
generateResetToken: function (email, expires, dbHash) {
return this.getByEmail(email).then(function (foundUser) {
if (!foundUser) {
- return when.reject(new Error('NotFound'));
+ return when.reject(new errors.NotFoundError('There is no user with that email address.'));
}
var hash = crypto.createHash('sha256'), | Descriptive error if user by mail not found.
closes #<I>
- Replaced generic NotFound error with descriptive NotFoundError. | TryGhost_Ghost | train | js,js |
551f66a8a25c7b93fa62325f25abd492b32e032d | diff --git a/indra/assemblers/cag_assembler.py b/indra/assemblers/cag_assembler.py
index <HASH>..<HASH> 100644
--- a/indra/assemblers/cag_assembler.py
+++ b/indra/assemblers/cag_assembler.py
@@ -93,10 +93,7 @@ class CAGAssembler(object):
# Add edge to the graph with metadata from statement
- if s.evidence:
- provenance = s.evidence[0].annotations.get('provenance', {})
- else:
- provenance = [{}]
+ provenance = s.evidence[0].annotations.get('provenance', {})
provenance[0]['text'] = s.evidence[0].text
self.CAG.add_edge(
self._node_name(s.subj), | removed if-else block that checks s.evidence | sorgerlab_indra | train | py |
403c54effa8d1fc7792f4a63731643d155634493 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -78,7 +78,19 @@ setup(
"Topic :: System :: Monitoring",
],
install_requires=[
- 'requests>=0.12.1',
+ # The currently used version of `setuptools` has a bug,
+ # so the version requirements are not properly respected.
+ #
+ # In the current version, `requests>= 0.12.1`
+ # always installs the latest version of the package.
+ 'requests>=0.12.1; python_version == "2.7"',
+ 'requests>=0.12.1; python_version >= "3.6"',
+ 'requests<2.26,>=0.12.1; python_version == "3.5"',
+ 'requests<2.22,>=0.12.1; python_version == "3.4"',
+ 'requests<2.19,>=0.12.1; python_version == "3.3"',
+ 'requests<1.2,>=0.12.1; python_version == "3.2"',
+ 'requests<1.2,>=0.12.1; python_version == "3.1"',
+ 'requests<1.2,>=0.12.1; python_version == "3.0"',
'six>=1.9.0'
],
tests_require=tests_require, | Explicitly define the maximum version required
The currently used version of `setuptools` has a bug,
so the version requirements are not properly respected.
In the current version, `requests>= <I>` always installs
the latest version of the package. | rollbar_pyrollbar | train | py |
fc70fd1108d951dd0d74cb92267f95a13a44dd81 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -150,3 +150,18 @@ describe('disabled history', function () {
assert.strictEqual(logged3Msgs.length, 11);
});
});
+
+describe('enabled throwErrors', function () {
+
+ var log4 = new Log('NameSpace4', {
+ throwErrors: true
+ });
+
+ it ('should throw errors when occurs', function () {
+ assert.throws(function () {
+ log4.warn('A warning message 1');
+ log4.warn('A warning message 2');
+ log4.error('An error message 1');
+ }, null, 'ERROR NameSpace4: An error message 1');
+ });
+}); | test: throwErrors case | romelperez_prhone-log | train | js |
94322dbf327e5fcc9d4bca4d29e4b9cae4ed3a72 | diff --git a/pyani/pyani_graphics.py b/pyani/pyani_graphics.py
index <HASH>..<HASH> 100644
--- a/pyani/pyani_graphics.py
+++ b/pyani/pyani_graphics.py
@@ -19,20 +19,17 @@ from . import pyani_config
from math import floor, log10
import warnings
-import numpy as np
-
-import scipy.cluster.hierarchy as sch
-import scipy.spatial.distance as distance
-
-import seaborn as sns
-import pandas as pd
-
-import matplotlib
# Specify matplotlib backend. This *must* be done before pyplot import, but
# raises errors with flake8 etc. So we comment out the specific error
+import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt # noqa: E402
import matplotlib.gridspec as gridspec # noqa: E402
+import numpy as np # noqa: E402
+import scipy.cluster.hierarchy as sch # noqa: E402
+import scipy.spatial.distance as distance # noqa: E402
+import seaborn as sns # noqa: E402
+import pandas as pd # noqa: E402
# Register Matplotlib colourmaps | modify imports in pyani_graphics.py to avoid build fail | widdowquinn_pyani | train | py |
5b9e0b1ba3495d1498022c5ea06e4981e1a09a1e | diff --git a/alot/message.py b/alot/message.py
index <HASH>..<HASH> 100644
--- a/alot/message.py
+++ b/alot/message.py
@@ -264,6 +264,7 @@ def encode_header(key, value):
for entry in rawentries:
m = re.search('\s*(.*)\s+<(.*\@.*\.\w*)>$', entry)
if m: # If a realname part is contained
+ name, address = m.groups()
# try to encode as ascii, if that fails, revert to utf-8
# name must be a unicode string here
header = Header(name) | reattach unintentionally removed line | pazz_alot | train | py |
ee53a8d1a93ddd119a7c06f6a47110d9c14f273e | diff --git a/test/test_cmds.py b/test/test_cmds.py
index <HASH>..<HASH> 100644
--- a/test/test_cmds.py
+++ b/test/test_cmds.py
@@ -3,6 +3,7 @@
import sys
import os
+import six
from cmdlet import *
from cmdlet.cmds import *
@@ -574,6 +575,11 @@ def test_to_str_cmd():
for i, v in enumerate(cmd1):
assert v == zen_of_python[i].encode('utf-8')
+ if six.PY2:
+ encoding = sys.stdout.encoding
+ del sys.stdout.encoding
cmd2 = zen_of_python | to_str
for i, v in enumerate(cmd2):
assert v == zen_of_python[i].encode('utf-8').decode('utf-8')
+ if six.PY2:
+ sys.stdout.encoding = encoding | Fixed encoding issue of test case in Python 2.x | GaryLee_cmdlet | train | py |
8624454b5261eb330c85456815e1e58392cc4e24 | diff --git a/lib/template/helpers/action.js b/lib/template/helpers/action.js
index <HASH>..<HASH> 100644
--- a/lib/template/helpers/action.js
+++ b/lib/template/helpers/action.js
@@ -76,7 +76,7 @@ exports.create = function (data) {
}
else if (typeof val === 'object') {
// Skip the item if it's just a format
- if (/:[a-z]*_?format/i.test(val.path)) {
+ if (/:([a-z]+_?)*format$/i.test(val.path)) {
continue;
} | include snake-case multi-word in :format regex
ProductCategory would turn into :product_category_format and thus needs this modified regex. | mde_ejs | train | js |
732f8e3b560b5ba307577faa5f6d7fe50f31afeb | diff --git a/lib/cli/cli.js b/lib/cli/cli.js
index <HASH>..<HASH> 100644
--- a/lib/cli/cli.js
+++ b/lib/cli/cli.js
@@ -612,6 +612,13 @@ module.exports.parseCommandLine = function parseCommandLine() {
type: 'string',
group: 'Chrome'
})
+ .option('browsertime.chrome.traceCategory', {
+ alias: 'chrome.traceCategory',
+ describe:
+ 'Add a trace category to the default ones. Use --chrome.traceCategory multiple times if you want to add multiple categories. Example: --chrome.traceCategory disabled-by-default-v8.cpu_profiler',
+ type: 'string',
+ group: 'Chrome'
+ })
.option('browsertime.chrome.enableTraceScreenshots', {
alias: 'chrome.enableTraceScreenshots',
describe: | Add example on how to add one Chrome trace category | sitespeedio_sitespeed.io | train | js |
9a882df4fad8132e7626da83c2abcb1cdd984a0a | diff --git a/coupons/__init__.py b/coupons/__init__.py
index <HASH>..<HASH> 100644
--- a/coupons/__init__.py
+++ b/coupons/__init__.py
@@ -1 +1 @@
-__version__ = '1.2.0a2'
+__version__ = '1.2.0a3' | release alpha 3 of <I> | byteweaver_django-coupons | train | py |
5567e115d543efe8055b5a173add817aa2c8b23f | diff --git a/src/select/index.js b/src/select/index.js
index <HASH>..<HASH> 100644
--- a/src/select/index.js
+++ b/src/select/index.js
@@ -19,7 +19,7 @@ export default class extends Component {
PropTypes.number
])
})
- ),
+ ).isRequired,
disabled: PropTypes.bool,
onChange: PropTypes.func,
onFocus: PropTypes.func, | :heavy_check_mark: select: options are required | yummies_core-components | train | js |
a31fdd31162befcd6941f1f02b5fa94a1e2a53ae | diff --git a/library/CM/FormField/Suggest.js b/library/CM/FormField/Suggest.js
index <HASH>..<HASH> 100644
--- a/library/CM/FormField/Suggest.js
+++ b/library/CM/FormField/Suggest.js
@@ -44,9 +44,10 @@ var CM_FormField_Suggest = CM_FormField_Abstract.extend({
},
createSearchChoice: function(term, data) {
if (field.getOption("enableChoiceCreate")) {
- if ($(data).filter(function() {
- return this.name.localeCompare(term) === 0;
- }).length === 0) {
+ var existingMatches = $(data).filter(function() {
+ return this.name.toLowerCase().localeCompare(term.toLowerCase()) === 0;
+ });
+ if (existingMatches.length === 0) {
return {'id': term, 'name': term, 'new': 1};
}
} | Ignore case when comparing existing vs. new choices in select2
When we have "Foo" and somebody types in "foo" we'll use the existing value then.
I think that's currently always desired - otherwise we can make it configurable in the future. | cargomedia_cm | train | js |
91d0b721ec5c48f9970c0d6a8154d5d2017283dd | diff --git a/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php b/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php
+++ b/src/Behat/Behat/HelperContainer/ServiceContainer/HelperContainerExtension.php
@@ -109,8 +109,10 @@ final class HelperContainerExtension implements Extension
{
if (method_exists($definition, 'isShared')) {
return $definition->isShared();
- } else {
+ } else if (method_exists($definition, 'getScope')) {
return $definition->getScope() !== ContainerBuilder::SCOPE_PROTOTYPE;
}
+
+ return false;
}
} | Flip check for deprecated code | Behat_Behat | train | php |
0f20c11535c5aefe8fe86902f8451865d967fa64 | diff --git a/lib/interfaces/IPermissions.js b/lib/interfaces/IPermissions.js
index <HASH>..<HASH> 100644
--- a/lib/interfaces/IPermissions.js
+++ b/lib/interfaces/IPermissions.js
@@ -44,6 +44,8 @@ class IPermissions {
if (!(context instanceof IChannel) && !(context instanceof IGuild))
throw new TypeError("context must be an instance of IChannel or IGuild");
+ if (!context._valid) throw new Error("Invalid context");
+
let overwrites = null;
if (context instanceof IChannel) {
overwrites = context.getRaw().permission_overwrites;
@@ -56,6 +58,8 @@ class IPermissions {
const member = user instanceof IGuildMember ?
user : context._discordie.Users.getMember(context.id, user.id);
+ if (!member) throw new Error("Invalid user");
+
const contextRaw = context.getRaw();
const roleEveryone = contextRaw ? contextRaw.roles.get(context.id) : null; | Validate context when resolving permissions | qeled_discordie | train | js |
b6bfe4dd6783c37683595161304fde4052ef09de | diff --git a/spec/hrr_rb_ssh/transport/data_type_spec.rb b/spec/hrr_rb_ssh/transport/data_type_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/hrr_rb_ssh/transport/data_type_spec.rb
+++ b/spec/hrr_rb_ssh/transport/data_type_spec.rb
@@ -319,7 +319,7 @@ RSpec.describe HrrRbSsh::Transport::DataType do
context "when arg is not within mpint value" do
it "encodes (1 << ((8 * 0xffff_ffff) + 1)); requires 0xffff_ffff + 1 bytes; with error" do
- expect { HrrRbSsh::Transport::DataType::Mpint.encode (1 << ((8 * 0xffff_ffff) + 1)) }.to raise_error RuntimeError
+ #expect { HrrRbSsh::Transport::DataType::Mpint.encode (1 << ((8 * 0xffff_ffff) + 1)) }.to raise_error RuntimeError
end
end
end | update transport/data_type_spec to remove slightly heavy case | hirura_hrr_rb_ssh | train | rb |
23c48c22c33856cdba09dc9801a153b4a536a380 | diff --git a/cumulusci/tasks/push/pushfails.py b/cumulusci/tasks/push/pushfails.py
index <HASH>..<HASH> 100644
--- a/cumulusci/tasks/push/pushfails.py
+++ b/cumulusci/tasks/push/pushfails.py
@@ -12,7 +12,7 @@ from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class ReportPushFailures(BaseSalesforceApiTask):
- """ Produce a report of the failed and otherwise anomalous push jobs.
+ """Produce a report of the failed and otherwise anomalous push jobs.
Takes a push request id and writes results to a CSV file. The task result contains the filename.
""" | Stripping out any changes not specifically made to test_push_tasks.py and tasks.py | SFDO-Tooling_CumulusCI | train | py |
2e4ba26cf79058deef9a780aa033b7b93d3d070d | diff --git a/spec/support/profile.rb b/spec/support/profile.rb
index <HASH>..<HASH> 100644
--- a/spec/support/profile.rb
+++ b/spec/support/profile.rb
@@ -10,7 +10,8 @@ module SpecSupport
location_in_building: '10.999',
building: '102 Petty France',
city: 'London',
- description: 'Lorem ipsum dolor sit amet...'
+ description: 'Lorem ipsum dolor sit amet...',
+ current_project: 'Donec tincidunt luctus ullamcorper.'
}
end
@@ -35,6 +36,7 @@ module SpecSupport
fill_in 'Building', with: person_attributes[:building]
fill_in 'City', with: person_attributes[:city]
fill_in 'Extra information', with: person_attributes[:description]
+ fill_in 'Current project', with: person_attributes[:current_project]
uncheck('Monday')
uncheck('Friday')
end
@@ -51,6 +53,7 @@ module SpecSupport
expect(page).to have_text(person_attributes[:building])
expect(page).to have_text(person_attributes[:city])
expect(page).to have_text(person_attributes[:description])
+ expect(page).to have_text(person_attributes[:current_project])
within('ul.working_days') do
expect(page).to_not have_selector("li.active[alt='Monday']") | Spec current project can be edited on person profile | ministryofjustice_peoplefinder | train | rb |
c205206ae2e9f2acef815fbfeb23023bc66f48a4 | diff --git a/test/APITest.php b/test/APITest.php
index <HASH>..<HASH> 100644
--- a/test/APITest.php
+++ b/test/APITest.php
@@ -594,13 +594,11 @@ class APITestCase extends PHPUnit_Framework_TestCase
print 'Test deleting an already deleted group';
}
-
public function testGetCustomerLogs(){
$logs = $this->api->get_customer_logs($this->log_address);
$this->assertEquals(false, empty($logs->logs));
print 'Test retrieving real customer logs';
-
}
public function testGetBadCustomerLogs(){ | Tests for customer logs - fixed whitespace | sendwithus_sendwithus_php | train | php |
e312a524b76529456b64c4cfeb2de0bb4806fd6f | diff --git a/code/extensions/TranslatableDataObject.php b/code/extensions/TranslatableDataObject.php
index <HASH>..<HASH> 100644
--- a/code/extensions/TranslatableDataObject.php
+++ b/code/extensions/TranslatableDataObject.php
@@ -175,8 +175,11 @@ class TranslatableDataObject extends DataExtension
}
// if not strict, check localized first and fallback to fieldname
- return $this->owner->hasField($localizedField)
- ? $this->owner->getField($localizedField) : $this->owner->getField($fieldName);
+ if($value = $this->owner->getField($localizedField)){
+ return $value;
+ }
+
+ return $this->owner->getField($fieldName);
}
/** | Fixed issue in translated value fallback. | bummzack_translatable-dataobject | train | php |
3ea9bbd2f8a77a29f8898f507672cb80b57bc421 | diff --git a/succss.js b/succss.js
index <HASH>..<HASH> 100644
--- a/succss.js
+++ b/succss.js
@@ -332,12 +332,21 @@ function Succss() {
phantom.injectJs('lib/resemble.js');
- var diff = resemble(imgBase.src).compareTo(imgCheck.src).onComplete(function(data){
+ resemble(imgBase.src).compareTo(imgCheck.src).onComplete(function(data){
var imgDiff = new Image();
imgDiff.src = data.getImageDataUrl();
imgDiff.onload = function() {
- var filePath = './resemble/' + SuccssCount.startTime + '/' + capture.basePath.replace(/^\.?\//, '');
- self.writeImgDiff(imgDiff, imgBase, imgCheck, filePath);
+ try {
+ var imagesMatch = !Math.round(data.misMatchPercentage);
+ if (!imagesMatch) {
+ var filePath = './resemble/' + SuccssCount.startTime + '/' + capture.basePath.replace(/^\.?\//, '');
+ self.writeImgDiff(imgDiff, imgBase, imgCheck, filePath);
+ }
+ casper.test.assertTrue(imagesMatch, 'Capture matches base screenshot (resemble).');
+ }
+ catch (e) {
+ self.catchErrors(e);
+ }
}
});
} | Improves self.resemble with try catch, imagesMatch boolean condition and casper test | B2F_Succss | train | js |
e45b6f91e79010663c840ef8ca96a1548179af5d | diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/document.rb
+++ b/lib/jekyll/document.rb
@@ -307,7 +307,7 @@ module Jekyll
populate_tags
if generate_excerpt?
- data['excerpt'] = Jekyll::Excerpt.new(self)
+ data['excerpt'] ||= Jekyll::Excerpt.new(self)
end
end | Document: Only auto-generate the excerpt if it's not overridden
Fixes #<I> | jekyll_jekyll | train | rb |
df4c2bab10c5e8bbca7b1d469aecc757d87869a5 | diff --git a/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java b/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java
index <HASH>..<HASH> 100644
--- a/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java
+++ b/processing/src/test/java/io/druid/segment/data/IncrementalIndexTest.java
@@ -376,13 +376,13 @@ public class IncrementalIndexTest
}
)
) {
- final Integer ranCount = someoneRan.get();
- if (ranCount > 0) {
+ final Integer maxValueExpected = someoneRan.get() + concurrentThreads;
+ if (maxValueExpected > 0) {
// Eventually consistent, but should be somewhere in that range
// Actual result is validated after all writes are guaranteed done.
Assert.assertTrue(
- String.format("%d >= %g >= 0 violated", ranCount, result),
- result >= 0 && result <= ranCount
+ String.format("%d >= %g >= 0 violated", maxValueExpected, result),
+ result >= 0 && result <= maxValueExpected
);
}
} | Soften concurrency requirements on IncrementalIndexTest | apache_incubator-druid | train | java |
186010673ad0682190a7e73c37974f240c1e3ba1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -107,8 +107,6 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Testing' | Remove the false Python3 support classifier
As the readme states:
Due to big API incompatibility between python <I>, <I> and <I>, the author of
HTTPretty is not supporting python3 officially. You will notice that the travis
build for python 3 might be broken, and while pull requests fixing py3 support
are most welcome, it is still not official at least for now.
it is preferable to not advertise support when it doesn't practically exist. | gabrielfalcao_HTTPretty | train | py |
8fb86568bf21735f0836d8341bb7db2c28238bce | diff --git a/session.go b/session.go
index <HASH>..<HASH> 100644
--- a/session.go
+++ b/session.go
@@ -790,7 +790,7 @@ func (s *session) handleUnpackedPacket(packet *unpackedPacket, rcvTime time.Time
if s.traceCallback != nil {
transportState = s.sentPacketHandler.GetStats()
s.traceCallback(quictrace.Event{
- Time: time.Now(),
+ Time: rcvTime,
EventType: quictrace.PacketReceived,
TransportState: transportState,
EncryptionLevel: packet.encryptionLevel, | use the receive time of a packet for tracing | lucas-clemente_quic-go | train | go |
c03fea058b8d73d1b316cc059becd1f92edafb61 | diff --git a/test/reactor/rollup-test.js b/test/reactor/rollup-test.js
index <HASH>..<HASH> 100644
--- a/test/reactor/rollup-test.js
+++ b/test/reactor/rollup-test.js
@@ -37,6 +37,16 @@ vows.describe('godot/reactor/rollup').addBatch({
'health',
2,
300
+ ),
+ "function as interval": macros.shouldEmitData(
+ godot
+ .reactor()
+ .rollup(function (period) {
+ return period * 100;
+ }, 2),
+ 'health',
+ 2,
+ 300
)
}
-}).export(module);
\ No newline at end of file
+}).export(module); | [test] add test case for a function used as interval for rollup | nodejitsu_godot | train | js |
ea4b6647a179193401cb53141b43e1074a46c5b3 | diff --git a/trunk/JLanguageTool/website/www/development/index.php b/trunk/JLanguageTool/website/www/development/index.php
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/website/www/development/index.php
+++ b/trunk/JLanguageTool/website/www/development/index.php
@@ -84,7 +84,7 @@ Here are some examples of patterns that can be used in that file:</p>
at the beginning of a sentence</li>
</ul>
-<p>A pattern's terms are matched case-insensitively by default, this can be changed
+<p>Pattern's terms are matched case-insensitively by default, this can be changed
by setting the <tt>case_sensitive</tt> attribute to <tt>yes</tt>.
<p>Here's an example of a complete rule that marks "bed English", "bat attitude"
@@ -93,7 +93,7 @@ etc as an error:</p>
<?php hl('<rule id="BED_ENGLISH" name="Possible typo 'bed/bat(bad) English/...'">
<pattern mark_from="0" mark_to="-1">
<token regexp="yes">bed|bat</token>
- <token regexp="yes">[Ee]nglish|attitude</token>
+ <token regexp="yes">English|attitude</token>
</pattern>
<message>Did you mean
<suggestion>bad</suggestion>? | improve example, thanks to Dominique Pellé | languagetool-org_languagetool | train | php |
f848a66e24971359c89f295d2e1095f558a88312 | diff --git a/packages/ui/app.js b/packages/ui/app.js
index <HASH>..<HASH> 100644
--- a/packages/ui/app.js
+++ b/packages/ui/app.js
@@ -8,6 +8,7 @@ const _ = require('lodash')
const bodyParser = require('body-parser')
const qs = require('querystring')
+const { version } = require('botpress/package.json')
const { HttpProxy } = require('@botpress/xx-util')
const BASE_PATH = '/api/v1'
@@ -140,7 +141,7 @@ app.get('/js/env.js', (req, res) => {
window.AUTH_TOKEN_DURATION = 21600000;
window.OPT_OUT_STATS = false;
window.SHOW_GUIDED_TOUR = false;
- window.BOTPRESS_VERSION = "10.22.3";
+ window.BOTPRESS_VERSION = "${version}";
window.APP_NAME = "Botpress";
window.GHOST_ENABLED = false;
window.BOTPRESS_FLOW_EDITOR_DISABLED = null; | feat(ui): report the proper bp version | botpress_botpress | train | js |
7e1b926503022f29a6cf36d557180212b6e389cf | diff --git a/src/elements/Icon/Icon.js b/src/elements/Icon/Icon.js
index <HASH>..<HASH> 100644
--- a/src/elements/Icon/Icon.js
+++ b/src/elements/Icon/Icon.js
@@ -45,7 +45,7 @@ function Icon(props) {
const ElementType = getElementType(Icon, props)
return (
- <ElementType {...rest} className={classes} />
+ <ElementType {...rest} aria-hidden='true' className={classes} />
)
}
diff --git a/test/specs/elements/Icon/Icon-test.js b/test/specs/elements/Icon/Icon-test.js
index <HASH>..<HASH> 100644
--- a/test/specs/elements/Icon/Icon-test.js
+++ b/test/specs/elements/Icon/Icon-test.js
@@ -28,4 +28,12 @@ describe('Icon', () => {
shallow(<Icon />)
.should.have.tagName('i')
})
+
+ describe('aria', () => {
+ it('should add aria-hidden to icon', () => {
+ const wrapper = shallow(<Icon />)
+
+ wrapper.should.have.prop('aria-hidden', 'true')
+ })
+ })
}) | fix(Icon): added aria-hidden attribute to icon (#<I>) | Semantic-Org_Semantic-UI-React | train | js,js |
523095c697db57e5b5d78dc82fbf671911a7dd6b | diff --git a/lib/affirm/client.rb b/lib/affirm/client.rb
index <HASH>..<HASH> 100644
--- a/lib/affirm/client.rb
+++ b/lib/affirm/client.rb
@@ -6,7 +6,7 @@ module Affirm
private :url_prefix
class << self
- def request(method, path, **data)
+ def request(method, path, data={})
new.public_send(method, path, data)
end
end
@@ -21,11 +21,11 @@ module Affirm
end
end
- def get(path, **data)
+ def get(path, data={})
connection.get(normalized_path(path), data)
end
- def post(path, **data)
+ def post(path, data={})
connection.post(normalized_path(path), data)
end | Fix error on Ruby 3
In Ruby 3, the double splat operator behavior has changed
This causes a "too many arguments" error. Specifying an optional array instead | spectator_affirm | train | rb |
09ef8e9598f1cddb1609342f90a04f938dc91450 | diff --git a/libs/juicebox/juice_diff.js b/libs/juicebox/juice_diff.js
index <HASH>..<HASH> 100644
--- a/libs/juicebox/juice_diff.js
+++ b/libs/juicebox/juice_diff.js
@@ -65,7 +65,6 @@ juice_diff.prototype.diff = function (path1, path2) {
store_compare_result.differences = 0
for (var i in store_compare_result.diffSet) {
const diff_item = store_compare_result.diffSet[i]
- console.log(diff_item)
if (diff_item.type == 'file' && diff_item.status != 'equal') {
store_compare_result.differences++;
}
@@ -133,16 +132,6 @@ function figure_out_timestamp (context) {
function figure_out_status (item) {
// if both files don't have meta timestamp compare creation times
if (!item.juicetimestamp1 && !item.juicetimestamp2) {
- // local_newer
- if (item.date1 > item.date2) {
- return item.status = 'local_newer'
- }
-
- // juice_newer
- if (item.date1 < item.date2) {
- return item.status = 'juice_newer'
- }
-
item.status = 'equal'
} | removed juicebox dependency on file creation date and solely rely on meta timestamp | Gottwik_Enduro | train | js |
06529b1a47b60d88a850f8f0e75ea25168d9b137 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -272,8 +272,7 @@ GulpSSHDeploy.prototype = {
_addTransferDistributionTask: function() {
var self = this;
- var deps = [];
- // var deps = ['makeRemotePath'];
+ var deps = ['makeRemoteDirectories'];
if (self.mOptions.package_task) {
deps.push(self.mOptions.package_task);
}
diff --git a/test/GulpSSHDeploy.spec.js b/test/GulpSSHDeploy.spec.js
index <HASH>..<HASH> 100644
--- a/test/GulpSSHDeploy.spec.js
+++ b/test/GulpSSHDeploy.spec.js
@@ -166,6 +166,9 @@ describe("gulp-ssh-deploy setup", function() {
new GulpSSHDeploy(modifiedOptions, gulp);
expect(gulp.tasks).to.have.ownProperty('transferDistribution');
+
+ // This task should depend on 'makeRemoteDirectories'
+ expect(gulp.tasks.transferDistribution.dep).to.include('makeRemoteDirectories');
});
it ("should appropriately set up the remote paths", () => { | :bug: Make sure remote directories are created before deploying.
Fixes #<I>. | jwir3_gulp-ssh-deploy | train | js,js |
Subsets and Splits