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 |
|---|---|---|---|---|---|
7b63fce3403a39dfcce34d6005e03f507ea586cc | diff --git a/spec/mailchimp3/endpoint_spec.rb b/spec/mailchimp3/endpoint_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mailchimp3/endpoint_spec.rb
+++ b/spec/mailchimp3/endpoint_spec.rb
@@ -167,6 +167,17 @@ describe MailChimp3::Endpoint do
end
end
end
+
+ context 'when the response is 204' do
+ before do
+ stub_request(:post, 'https://us2.api.mailchimp.com/3.0/lists')
+ .to_return(status: 204, body: nil, headers: { 'Content-Type' => 'application/json; charset=utf-8' })
+ end
+
+ it 'returns true' do
+ expect(subject.post(resource)).to eq(true)
+ end
+ end
end
describe '#patch' do | spec: add coverage for <I> return on post | seven1m_mailchimp3 | train | rb |
389ceaf1dbaf9ddd3cf74acf1a57fd2e0ac9e6ed | diff --git a/clients/naming/lib/torquebox/naming.rb b/clients/naming/lib/torquebox/naming.rb
index <HASH>..<HASH> 100644
--- a/clients/naming/lib/torquebox/naming.rb
+++ b/clients/naming/lib/torquebox/naming.rb
@@ -92,7 +92,7 @@ module TorqueBox
begin
attempts += 1
yield
- rescue
+ rescue javax.naming.CommunicationException
if attempts > max_retries
raise
else | Be more specific when falling back to naming defaults after an exception | torquebox_torquebox | train | rb |
38fe77e78c0451fea9d12a3530bef449cba83d08 | diff --git a/lib/protocols/shutter3.js b/lib/protocols/shutter3.js
index <HASH>..<HASH> 100644
--- a/lib/protocols/shutter3.js
+++ b/lib/protocols/shutter3.js
@@ -14,7 +14,7 @@ module.exports = function(helper) {
return protocolInfo = {
name: 'shutter3',
type: 'command',
- commands: ["up", "down", "stop"],
+ commands: ["up", "down", "stop", "program"],
values: {
id: {
type: "number"
@@ -41,6 +41,8 @@ module.exports = function(helper) {
return 'down';
case '101':
return 'stop';
+ case '100':
+ return 'program';
}
})());
return result = {
@@ -61,6 +63,8 @@ module.exports = function(helper) {
return '011001';
case 'stop':
return '101010';
+ case 'program':
+ return '100110';
}
})());
command = helper.map(commandcode, binaryToPulse); | Updated generated file shutter3.js, issue #<I> | pimatic_rfcontroljs | train | js |
b7b99a3a068c4b22c2d4f3d54f0a599a02fc6c87 | diff --git a/tests/integration/modules/cmdmod.py b/tests/integration/modules/cmdmod.py
index <HASH>..<HASH> 100644
--- a/tests/integration/modules/cmdmod.py
+++ b/tests/integration/modules/cmdmod.py
@@ -39,13 +39,15 @@ class CMDModuleTest(integration.ModuleCase):
@patch('pwd.getpwnam')
@patch('subprocess.Popen')
@patch('json.loads')
- def test_os_environment_remains_intact(self, *mocks):
+ def test_os_environment_remains_intact(self,
+ loads_mock,
+ popen_mock,
+ getpwnam_mock):
'''
Make sure the OS environment is not tainted after running a command
that specifies runas.
'''
environment = os.environ.copy()
- loads_mock, popen_mock, getpwnam_mock = mocks
popen_mock.return_value = Mock(
communicate=lambda *args, **kwags: ['{}', None], | Let's see if PyLint stops complaining. | saltstack_salt | train | py |
68745951521eadaacbd9fe5c109315c8aebef608 | diff --git a/middleware/terminal.go b/middleware/terminal.go
index <HASH>..<HASH> 100644
--- a/middleware/terminal.go
+++ b/middleware/terminal.go
@@ -32,7 +32,7 @@ var (
reset = []byte{'\033', '[', '0', 'm'}
)
-var isTTY bool
+var IsTTY bool
func init() {
// This is sort of cheating: if stdout is a character device, we assume
@@ -47,17 +47,17 @@ func init() {
fi, err := os.Stdout.Stat()
if err == nil {
m := os.ModeDevice | os.ModeCharDevice
- isTTY = fi.Mode()&m == m
+ IsTTY = fi.Mode()&m == m
}
}
// colorWrite
func cW(w io.Writer, useColor bool, color []byte, s string, args ...interface{}) {
- if isTTY && useColor {
+ if IsTTY && useColor {
w.Write(color)
}
fmt.Fprintf(w, s, args...)
- if isTTY && useColor {
+ if IsTTY && useColor {
w.Write(reset)
}
} | export middleware.IsTTY so it can be set in tests | go-chi_chi | train | go |
c67d7a3d4d32e473fcf096628f990e55cc431ec9 | diff --git a/generators/app/templates/gulp/watch-assets.js b/generators/app/templates/gulp/watch-assets.js
index <HASH>..<HASH> 100644
--- a/generators/app/templates/gulp/watch-assets.js
+++ b/generators/app/templates/gulp/watch-assets.js
@@ -42,19 +42,19 @@ module.exports = (gulp, plugins) => {
isDependentStyleSource(e.path) ||
'unlink' === e.event
) {
- processChange('cssCache', clearCssCache, 12000);
+ processChange('cssCache', clearCssCache, 5000);
}
}
function clearCache() {
- processChange('jsCache', clearJsCache, 12000);
- processChange('cssCache', clearCssCache, 12000);
+ processChange('jsCache', clearJsCache, 5000);
+ processChange('cssCache', clearCssCache, 5000);
}
const lastRun = {};
function processChange(type, func, throttle) {
type = type || 'other';
func = func || function(){};
- throttle = throttle || 2000;
+ throttle = throttle || 1000;
// call function only once in defined time
lastRun[type] = lastRun[type] || 0;
@@ -76,7 +76,7 @@ module.exports = (gulp, plugins) => {
utils.updateSourcePatterns();
gulp.start('compile-css');
gulp.start('compile-js');
- }, 5000);
+ }, 6000);
});
plugins.watch([ | change cache invalidation again - we should look for better solution | namics_generator-nitro | train | js |
3c63a5b615344b46bac1fbc815362a4d2f68ee5d | diff --git a/src/models/data/SeoData.php b/src/models/data/SeoData.php
index <HASH>..<HASH> 100644
--- a/src/models/data/SeoData.php
+++ b/src/models/data/SeoData.php
@@ -105,9 +105,16 @@ class SeoData extends BaseObject
// Find the first unlocked token
if (is_string($title) && !empty($template))
+ {
foreach ($template as $index => $tmpl)
- if ($tmpl['locked'] === '0')
- $title = [$template[$index]['key'] => $title];
+ {
+ if ($tmpl['locked'] !== '0')
+ continue;
+
+ $title = [$template[$index]['key'] => $title];
+ break;
+ }
+ }
$config['titleRaw'] = $title;
unset($config['title']); | Only populate the first unlocked token on upgrade | ethercreative_seo | train | php |
62b2006f41c51eec92834c04c17b72ce7e5136a6 | diff --git a/src/Config.php b/src/Config.php
index <HASH>..<HASH> 100644
--- a/src/Config.php
+++ b/src/Config.php
@@ -2,7 +2,7 @@
namespace Cauditor;
-use MatthiasMullie\PathConverter\Converter;
+use MatthiasMullie\PathConverter\Converter as PathConverter;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser;
@@ -77,7 +77,7 @@ class Config implements \ArrayAccess
return $value;
}
- $converter = new Converter(dirname($this->config['config_path']), $this->config['path']);
+ $converter = new PathConverter(dirname($this->config['config_path']), $this->config['path']);
return $converter->convert($value);
} | Fix confusion about similarly-named classes | cauditor_php-analyzer | train | php |
d621fbc48f97f22df4564405eca684f2e6d11af7 | diff --git a/ServiceProvider.php b/ServiceProvider.php
index <HASH>..<HASH> 100755
--- a/ServiceProvider.php
+++ b/ServiceProvider.php
@@ -25,14 +25,14 @@ abstract class ServiceProvider
*
* @var array
*/
- protected static $publishes = [];
+ public static $publishes = [];
/**
* The paths that should be published by group.
*
* @var array
*/
- protected static $publishGroups = [];
+ public static $publishGroups = [];
/**
* Create a new service provider instance. | Proof of concept of integration testing the framework itself.
This leverages the test bench package to integration test the framework
itself using a dummy application, allowing for richer integration tests. | illuminate_support | train | php |
a51f1c40466abd6caba522aa6af342b4d45f49b7 | diff --git a/src/CardPanel.js b/src/CardPanel.js
index <HASH>..<HASH> 100644
--- a/src/CardPanel.js
+++ b/src/CardPanel.js
@@ -11,7 +11,7 @@ const CardPanel = ({
};
return (
- <div className={cx(classes, className)}>
+ <div className={cx(classes, className)} {...props}>
<span>{children}</span>
</div>
); | re #<I> append extra properties for CardPanel | react-materialize_react-materialize | train | js |
05032d2adac0af93c3a766afe7b374a5f9381b45 | diff --git a/src/scs_core/model/gas/vE/ve_gas_inference_client.py b/src/scs_core/model/gas/vE/ve_gas_inference_client.py
index <HASH>..<HASH> 100644
--- a/src/scs_core/model/gas/vE/ve_gas_inference_client.py
+++ b/src/scs_core/model/gas/vE/ve_gas_inference_client.py
@@ -93,7 +93,14 @@ class VEGasInferenceClient(GasInferenceClient):
# gas baseline...
for gas, offset in self.__gas_baseline.offsets().items():
path = '.'.join(('val', gas, 'cnc'))
- baselined_cnc = round(float(exg.node(sub_path=path)) + offset, 1)
+
+ try:
+ node = exg.node(sub_path=path)
+ except KeyError:
+ self.__logger.error('VEGasInferenceClient: %s not found in exg' % path)
+ continue
+
+ baselined_cnc = round(float(node) + offset, 1)
exg.append(path, round(baselined_cnc, 1))
# report... | Added protection from incorrect baselines in VEGasInferenceClient | south-coast-science_scs_core | train | py |
76efdd0a3f011698cda5fb06bc8db0c973682752 | diff --git a/src/ChrisKonnertz/DeepLy/DeepLy.php b/src/ChrisKonnertz/DeepLy/DeepLy.php
index <HASH>..<HASH> 100644
--- a/src/ChrisKonnertz/DeepLy/DeepLy.php
+++ b/src/ChrisKonnertz/DeepLy/DeepLy.php
@@ -337,18 +337,20 @@ class DeepLy
/**
* Decides if a language (code) is supported by DeepL(y).
- * Note that 'auto' is not a valid value in this context.
+ * Note that 'auto' is not a valid value in this context
+ * except you explicitly set the $allowAuto param to true
*
- * @param string $langCode The language code, for example 'EN'
+ * @param string $langCode The language code, for example 'EN'
+ * @param bool $allowAuto Opional: If false, 'auto' is not a valid langue
* @return bool
*/
- public function supportsLangCode($langCode)
+ public function supportsLangCode($langCode, $allowAuto = false)
{
if (! is_string($langCode)) {
throw new \InvalidArgumentException('The $langCode argument has to be a string');
}
- $supported = in_array($langCode, $this->getLangCodes(false));
+ $supported = in_array($langCode, $this->getLangCodes($allowAuto));
return $supported;
} | Added $allowAuto param to supportsLangCode method | chriskonnertz_DeepLy | train | php |
be7793a95abd8db6ff49a7f6f04e1fc63c89b5ce | diff --git a/openquake/engine/job/validation.py b/openquake/engine/job/validation.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/job/validation.py
+++ b/openquake/engine/job/validation.py
@@ -1151,7 +1151,7 @@ def insured_losses_is_valid(_mdl):
def loss_curve_resolution_is_valid(mdl):
if mdl.calculation_mode == 'event_based':
if (mdl.loss_curve_resolution is not None and
- mdl.loss_curve_resolution < 1):
+ mdl.loss_curve_resolution <= 1):
return False, ['Loss Curve Resolution must be > 1.']
return True, [] | job/validation:
Corrected some logic in `loss_curve_resolution_is_valid`. | gem_oq-engine | train | py |
0bbce2ec9199d2a7b4855a9720353ef49e2bc59f | diff --git a/php/commands/core.php b/php/commands/core.php
index <HASH>..<HASH> 100644
--- a/php/commands/core.php
+++ b/php/commands/core.php
@@ -1129,6 +1129,10 @@ EOT;
*
* Defaults to updating WordPress to the latest version.
*
+ * If you see "Error: Another update is currently in progress.", you may
+ * need to run `wp option delete core_updater.lock` after verifying another
+ * update isn't actually running.
+ *
* ## OPTIONS
*
* [<zip>] | Mention update lock behavior in core update docs | wp-cli_export-command | train | php |
768c5f4ba7fdfd069a1faa6915b6796fa2e843a1 | diff --git a/panc/src/main/scripts/panlint/panlint.py b/panc/src/main/scripts/panlint/panlint.py
index <HASH>..<HASH> 100755
--- a/panc/src/main/scripts/panlint/panlint.py
+++ b/panc/src/main/scripts/panlint/panlint.py
@@ -180,7 +180,6 @@ class LineChecks:
valid = False
messages.add('after')
end += 1
- messages = list(messages)
messages = sorted(list(messages), key=None, reverse=True)
message_text = '%s space %s operator' % (reason, ' and '.join(messages)) | panlint: Remove duplicated line | quattor_pan | train | py |
a227869c578b4725cfa2803d8d183afa470aab0f | diff --git a/js/bcex.js b/js/bcex.js
index <HASH>..<HASH> 100644
--- a/js/bcex.js
+++ b/js/bcex.js
@@ -408,13 +408,13 @@ module.exports = class bcex extends Exchange {
await this.loadMarkets ();
let request = {};
if (typeof symbol !== 'undefined') {
- request['symbol'] = this.marketId (symbol);;
+ request['symbol'] = this.marketId (symbol);
}
if (typeof id !== 'undefined') {
request['order_id'] = id;
}
- let results = await this.privatePostApiOrderCancel (this.extend (request, params));
- return results;
+ let response = await this.privatePostApiOrderCancel (this.extend (request, params));
+ return response;
}
sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { | bcex cancelOrder excessive semicolon | ccxt_ccxt | train | js |
6ef9d426eb259650c8a4ff5c25c878f462c2bb9d | diff --git a/tests/integration/models_images_test.py b/tests/integration/models_images_test.py
index <HASH>..<HASH> 100644
--- a/tests/integration/models_images_test.py
+++ b/tests/integration/models_images_test.py
@@ -39,6 +39,17 @@ class ImageCollectionTest(BaseIntegrationTest):
self.tmp_imgs.append(image.id)
assert client.containers.run(image) == b"hello world\n"
+ def test_build_with_success_build_output(self):
+ client = docker.from_env(version=TEST_API_VERSION)
+ image = client.images.build(
+ tag='dup-txt-tag', fileobj=io.BytesIO(
+ "FROM alpine\n"
+ "CMD echo Successfully built 33c838732b70".encode('ascii')
+ )
+ )
+ self.tmp_imgs.append(image.id)
+ assert client.containers.run(image) == b"Successfully built 33c838732b70\n"
+
def test_list(self):
client = docker.from_env(version=TEST_API_VERSION)
image = client.images.pull('alpine:latest') | added integration test for #<I> for ImageCollection.build() that verfies that the build method uses the last success message for extracting the image id | docker_docker-py | train | py |
14782ac33ab150f302470c72ae1f50a5a6e01168 | diff --git a/app/main/main.js b/app/main/main.js
index <HASH>..<HASH> 100644
--- a/app/main/main.js
+++ b/app/main/main.js
@@ -14,8 +14,6 @@ const {initAutoUpdater} = require('./updater.js')
let serverManager = new ServerManager()
let mainWindow
-fs.rmdirSync(path.join(app.getPath("userData"), "Cache"))
-
if (process.env.NODE_ENV == 'development'){
require('electron-debug')({showDevTools: 'undocked'});
}
@@ -23,6 +21,7 @@ if (process.env.NODE_ENV == 'development'){
function createWindow () {
mainWindow = new BrowserWindow({width: 1200, height: 900})
// TODO: use FLASK port when not in development
+ mainWindow.webContents.clearHistory()
mainWindow.loadURL("http://127.0.0.1:31950")
mainWindow.on('closed', function () { | remove fs, clear cache with webContents API | Opentrons_opentrons | train | js |
dbf1c942ea8f657301c79d0a474d0e4ecac52af9 | diff --git a/blueflood-core/src/test/java/com/rackspacecloud/blueflood/types/AbstractRollupStatTest.java b/blueflood-core/src/test/java/com/rackspacecloud/blueflood/types/AbstractRollupStatTest.java
index <HASH>..<HASH> 100644
--- a/blueflood-core/src/test/java/com/rackspacecloud/blueflood/types/AbstractRollupStatTest.java
+++ b/blueflood-core/src/test/java/com/rackspacecloud/blueflood/types/AbstractRollupStatTest.java
@@ -326,4 +326,32 @@ public class AbstractRollupStatTest {
// then
// the exception is thrown
}
+
+ @Test
+ public void setLongDoesNotChangeDoubleValue() {
+
+ // given
+ double value = 123.45d;
+ SimpleStat stat = new SimpleStat(value);
+
+ // when
+ stat.setLongValue(678L);
+
+ // then
+ assertEquals(value, stat.toDouble(), 0.00001d);
+ }
+
+ @Test
+ public void setDoubleDoesNotChangeLongValue() {
+
+ // given
+ long value = 123L;
+ SimpleStat stat = new SimpleStat(value);
+
+ // when
+ stat.setDoubleValue(678.9d);
+
+ // then
+ assertEquals(value, stat.toLong());
+ }
} | Test to indicate that setting the double value doesn't change the long value, and vice-versa. | rackerlabs_blueflood | train | java |
d1d4126987d1caf77de09ae1d7073cec7a77840d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,15 +7,14 @@ from setuptools import setup, find_packages
setup(
name='dirichlet',
- version='0.5',
+ version='0.7',
description='Calculates Dirichlet test and plots 2-simplex Dirichlets',
author='Eric Suh',
author_email='contact@ericsuh.com',
- py_modules=['dirichlet'],
- provides=['dirichlet'],
+ packages=['dirichlet'],
install_requires = [
'scipy >= 0.10.1',
- 'numpy >= 1.7.0',
+ 'numpy >= 1.6.2',
'matplotlib >= 1.2.0',
],
url='http://github.com/ericsuh/dirichlet', | Version bump to <I>, fixing setup.py syntax | ericsuh_dirichlet | train | py |
0784f19a779d7434b7767a1d8583a289b13d531d | diff --git a/ghost/admin/serializers/post.js b/ghost/admin/serializers/post.js
index <HASH>..<HASH> 100644
--- a/ghost/admin/serializers/post.js
+++ b/ghost/admin/serializers/post.js
@@ -54,6 +54,8 @@ var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
// Don't ever pass uuid's
delete data.uuid;
+ // Don't send HTML
+ delete data.html;
hash[root] = [data];
} | Don't send HTML on post save.
fixes #<I>
- adjusts post serialiser to not send HTML content | TryGhost_Ghost | train | js |
aa88e486670b563fb14a69e4895c4771b2c7d64c | diff --git a/tests/test_flake8.py b/tests/test_flake8.py
index <HASH>..<HASH> 100644
--- a/tests/test_flake8.py
+++ b/tests/test_flake8.py
@@ -20,6 +20,7 @@ from flake8.api import legacy as flake8
import os
import logging
+# flake8 is logging is really verbose. disable.
logging.disable(logging.CRITICAL) | Commented why to turn of logging in test_flake8 | xenon-middleware_pyxenon | train | py |
cf916f6e51ef237629349581a8705b64b61348dc | diff --git a/port.js b/port.js
index <HASH>..<HASH> 100644
--- a/port.js
+++ b/port.js
@@ -22,7 +22,7 @@ Port.prototype.setOptions = function(options){
max: ('max' in options) ? options.max : 1, // max connections
pd: ('pd' in options) ? options.pd
: (('darwin' == process.platform)
- ? '/Applications/Pd-0.45-4-64bit.app/Contents/Resources/bin/pd'
+ ? '/Applications/Pd-0.45-5-64bit.app/Contents/Resources/bin/pd'
: 'pd'),
flags: options.flags || [] // ['-noprefs', '-stderr', './port.pd']
}; | use Pd-<I>-5-<I>bit.app on osx | thisconnect_port | train | js |
1de99e791fc5008955c7558ad19aa0d8c8197eb7 | diff --git a/test/integration/generated_secret_test.rb b/test/integration/generated_secret_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/generated_secret_test.rb
+++ b/test/integration/generated_secret_test.rb
@@ -8,7 +8,8 @@ describe "The generated Secret module" do
rescue
skip "No GIR data for Secret available"
end
- Secret::Schema.new("foo", :none, "bar" => :string)
+ instance = Secret::Schema.new("foo", :none, "bar" => :string)
+ instance.must_be_instance_of Secret::Schema
end
end
end | Improve integration test for Secret::Schema | mvz_gir_ffi | train | rb |
eec21f7ba64a9962da430c97927767832100cee9 | diff --git a/src/test/java/com/terradue/jcatalogue/client/CatalogueClientTestCase.java b/src/test/java/com/terradue/jcatalogue/client/CatalogueClientTestCase.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/terradue/jcatalogue/client/CatalogueClientTestCase.java
+++ b/src/test/java/com/terradue/jcatalogue/client/CatalogueClientTestCase.java
@@ -164,4 +164,18 @@ public final class CatalogueClientTestCase
} );
}
+ /**
+ * @since 0.2
+ */
+ @Test
+ public void accessToDataSet()
+ throws Exception
+ {
+ DataSet dataSet = client.getDataSet( "http://10.11.12.248/catalogue/gpod/ERS2_WILMA/AMI_WILM__0P_19950718T144654_19950718T144710_KS_01267.E2/atom" );
+
+ System.out.println( dataSet );
+
+ assertNotNull( dataSet );
+ }
+
} | added test to get a single DataSet | Terradue_jcatalogue-client | train | java |
9e63a0b2ff0eb5b9325cb01f68587978107d24a0 | diff --git a/SwatDB/SwatDB.php b/SwatDB/SwatDB.php
index <HASH>..<HASH> 100644
--- a/SwatDB/SwatDB.php
+++ b/SwatDB/SwatDB.php
@@ -40,7 +40,9 @@ class SwatDB
{
$mdb2_wrapper = ($wrapper === null) ? false : $wrapper;
SwatDB::debug($sql);
- $rs = $db->query($sql, $types, true, $mdb2_wrapper);
+
+ $mdb2_types = $types === null ? true : $types;
+ $rs = $db->query($sql, $mdb2_types, true, $mdb2_wrapper);
if (MDB2::isError($rs))
throw new SwatDBException($rs); | Use new functionality in upstream MDB2 to automatically figure out types.
svn commit r<I> | silverorange_swat | train | php |
b5436223ff45b99ef080326d841f475ce991d5d9 | diff --git a/cookiecutter/main.py b/cookiecutter/main.py
index <HASH>..<HASH> 100755
--- a/cookiecutter/main.py
+++ b/cookiecutter/main.py
@@ -30,19 +30,18 @@ builtin_abbreviations = {
'bb': 'https://bitbucket.org/{0}',
}
-REPO_REGEX = """
-(
-((git|ssh|https|http):(//)?) # something like git:// ssh:// etc.
- | # or
- (\w+@[\w\.]+) # something like user@...
+REPO_REGEX = re.compile(r"""
+(?x)
+((((git|hg)\+)?(git|ssh|https?):(//)?) # something like git:// ssh:// etc.
+ | # or
+ (\w+@[\w\.]+) # something like user@...
)
-.*
-"""
+""")
def is_repo_url(value):
"""Return True if value is a repository URL."""
- return bool(re.match(REPO_REGEX, value, re.VERBOSE))
+ return bool(REPO_REGEX.match(value))
def expand_abbreviations(template, config_dict): | Fix the repo regex to handle + in URLs.
The documentation said that you could do git+https:// or git+ssh:// but
that was not, in fact, true. | audreyr_cookiecutter | train | py |
eabe425c959311fd98e5e8d9d007fcc3b6c6d477 | diff --git a/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/util/IntegrationTestUtils.java b/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/util/IntegrationTestUtils.java
index <HASH>..<HASH> 100644
--- a/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/util/IntegrationTestUtils.java
+++ b/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/util/IntegrationTestUtils.java
@@ -1288,7 +1288,7 @@ public class IntegrationTestUtils {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd-HHmmss.SSS");
String now = format.format(new Date(System.currentTimeMillis()));
- FileUtils.copyFile(scrFile, new File(prefix + now + ".png"));
+ FileUtils.copyFile(scrFile, new File("build/reports/", prefix + now + ".png"));
} catch (IOException e) {
e.printStackTrace();
} | Place FB screenshots in directory that will get uploaded to S3
So that we can troubleshoot travis failures | cloudfoundry_uaa | train | java |
f48585cf0b144f9cd9707bc8329d3f08ee9aec64 | diff --git a/tests/Large/C/Entity/Fields/Traits/TimeStamp/UpdatedAtTimestampFieldTraitTest.php b/tests/Large/C/Entity/Fields/Traits/TimeStamp/UpdatedAtTimestampFieldTraitTest.php
index <HASH>..<HASH> 100644
--- a/tests/Large/C/Entity/Fields/Traits/TimeStamp/UpdatedAtTimestampFieldTraitTest.php
+++ b/tests/Large/C/Entity/Fields/Traits/TimeStamp/UpdatedAtTimestampFieldTraitTest.php
@@ -35,6 +35,19 @@ class UpdatedAtTimestampFieldTraitTest extends AbstractFieldTraitTest
* @test
* @throws \Exception
*/
+ public function createEntityWithField(): void
+ {
+ $entity = $this->getEntity();
+ $getter = $this->getGetter($entity);
+ self::assertTrue(\method_exists($entity, $getter));
+ $value = $entity->$getter();
+ self::assertInstanceOf(\DateTimeImmutable::class, $value);
+ }
+
+ /**
+ * @test
+ * @throws \Exception
+ */
public function updateEntityWithField(): void
{
$entity = $this->getEntity(); | Overrode create entity with field test on update time stamp field to check for date time immutable | edmondscommerce_doctrine-static-meta | train | php |
e57d953f118ae0a229a49fe8ee577b65753dde1a | diff --git a/src/Caouecs/Sirtrevorjs/Converter/ImageConverter.php b/src/Caouecs/Sirtrevorjs/Converter/ImageConverter.php
index <HASH>..<HASH> 100644
--- a/src/Caouecs/Sirtrevorjs/Converter/ImageConverter.php
+++ b/src/Caouecs/Sirtrevorjs/Converter/ImageConverter.php
@@ -53,7 +53,7 @@ class ImageConverter extends BaseConverter implements ConverterInterface
*/
public function imageToHtml()
{
- if (empty($this->data['file.url'])) {
+ if (empty($this->data['file']['url'])) {
return '';
}
@@ -63,7 +63,7 @@ class ImageConverter extends BaseConverter implements ConverterInterface
$text = $this->parser->toHtml($text);
}
- $url = $this->data['file.url'] ?? '';
+ $url = $this->data['file']['url'] ?? '';
try {
$size = getimagesize($url); | Update ImageConverter.php
It should be $this->data['file']['url'] not $this->data['file.url'] to get the file -> url in the data array. | caouecs_Laravel-SirTrevorJS | train | php |
6f606c6bb1e5eaf74f9c722e4c22ba028d82952f | diff --git a/internal/loop/run.go b/internal/loop/run.go
index <HASH>..<HASH> 100644
--- a/internal/loop/run.go
+++ b/internal/loop/run.go
@@ -89,13 +89,15 @@ func (c *runContext) updateCount(now int64) int {
return 0
}
- if clock.IsValid() && c.lastClockFrame != clock.Now() {
- sync = true
- f := clock.Now()
- if c.frames < f {
- count = int(f - c.frames)
+ if clock.IsValid() {
+ if c.lastClockFrame != clock.Now() {
+ sync = true
+ f := clock.Now()
+ if c.frames < f {
+ count = int(f - c.frames)
+ }
+ c.lastClockFrame = f
}
- c.lastClockFrame = f
} else {
if t > 5*int64(time.Second)/int64(FPS) {
// The previous time is too old. Let's assume that the window was unfocused. | loop: Bug fix: Don't use 'system timer clock' when audio clock is valid | hajimehoshi_ebiten | train | go |
018d30cd43535a65f7ce5316b5c9291a9bcb86f6 | diff --git a/croppie.js b/croppie.js
index <HASH>..<HASH> 100755
--- a/croppie.js
+++ b/croppie.js
@@ -900,7 +900,7 @@
prom.then(function () {
if (self.options.useCanvas) {
self.elements.img.exifdata = null;
- _transferImageToCanvas.call(self, options.orientation);
+ _transferImageToCanvas.call(self, options.orientation || 1);
}
_updatePropertiesFromImage.call(self);
_triggerUpdate.call(self); | always pass some sort or orientation, even if it's just 1 - #<I> | Foliotek_Croppie | train | js |
df1aa1b2ee7637c314e215b8125c4fd7ff40c159 | diff --git a/libcentrifugo/hubs.go b/libcentrifugo/hubs.go
index <HASH>..<HASH> 100644
--- a/libcentrifugo/hubs.go
+++ b/libcentrifugo/hubs.go
@@ -38,6 +38,7 @@ func (h *clientHub) shutdown() {
for uid := range user {
cc, ok := h.conns[uid]
if !ok {
+ wg.Done()
continue
}
go func(cc clientConn) {
@@ -150,8 +151,6 @@ func (h *clientHub) removeSub(chID ChannelID, c clientConn) (bool, error) {
uid := c.uid()
- delete(h.conns, uid)
-
// try to find subscription to delete, return early if not found.
if _, ok := h.subs[chID]; !ok {
return true, nil | fix removing subscription and possible deadlock in shutdown | centrifugal_centrifugo | train | go |
24c08cf86dd4be0603da572073389f485c29051f | diff --git a/src/test/java/apoc/util/TestUtil.java b/src/test/java/apoc/util/TestUtil.java
index <HASH>..<HASH> 100644
--- a/src/test/java/apoc/util/TestUtil.java
+++ b/src/test/java/apoc/util/TestUtil.java
@@ -46,9 +46,13 @@ public class TestUtil {
private static void printFullStackTrace(Throwable e) {
String padding = "";
while (e != null) {
- System.err.println(padding + e.getMessage());
- for (StackTraceElement element : e.getStackTrace()) {
- System.err.println(padding + element.toString());
+ if (e.getCause() == null) {
+ System.err.println(padding + e.getMessage());
+ for (StackTraceElement element : e.getStackTrace()) {
+ if (element.getClassName().matches("^(org.junit|org.apache.maven|sun.reflect|apoc.util.TestUtil|scala.collection|java.lang.reflect|org.neo4j.cypher.internal|org.neo4j.kernel.impl.proc|sun.net|java.net).*"))
+ continue;
+ System.err.println(padding + element.toString());
+ }
}
e=e.getCause();
padding += " "; | some stacktrace-filtering for the output | neo4j-contrib_neo4j-apoc-procedures | train | java |
2becf94c05b865ebc8aa880222f86a83ef372eca | diff --git a/lib/validate.js b/lib/validate.js
index <HASH>..<HASH> 100644
--- a/lib/validate.js
+++ b/lib/validate.js
@@ -222,7 +222,7 @@ module.exports = {
}
// Webpack config can be a Promise, If it's a Promise wait for resolved config object.
- if (this.webpackConfig instanceof Promise) {
+ if (this.webpackConfig && this.webpackConfig instanceof Promise) {
this.webpackConfig.then(config => processConfig(config));
} else {
processConfig(this.webpackConfig); | this.webpackConfig check added
If condition extended to check whether this.webpackConfig is falsy. | serverless-heaven_serverless-webpack | train | js |
f161ac2980945bc958a94607079f6cc01bb1cdc6 | diff --git a/generators/server/templates/src/main/java/package/gateway/accesscontrol/_AccessControlFilter.java b/generators/server/templates/src/main/java/package/gateway/accesscontrol/_AccessControlFilter.java
index <HASH>..<HASH> 100644
--- a/generators/server/templates/src/main/java/package/gateway/accesscontrol/_AccessControlFilter.java
+++ b/generators/server/templates/src/main/java/package/gateway/accesscontrol/_AccessControlFilter.java
@@ -55,7 +55,9 @@ public class AccessControlFilter extends ZuulFilter {
if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) {
if (isAuthorizedRequest(serviceUrl, serviceName, requestUri)) {
return false;
- }
+ }else{
+ return true;
+ }
}
}
return true; | Code Enhancement in AccessControlFilter.java
stopped Unnecessary looping in code when endpoint is found to be not authorized
Fix #<I> | jhipster_generator-jhipster | train | java |
fa092e5bef2a19ab5b36e37d52d7ce7da928b303 | diff --git a/src/shapes/poly.js b/src/shapes/poly.js
index <HASH>..<HASH> 100644
--- a/src/shapes/poly.js
+++ b/src/shapes/poly.js
@@ -174,7 +174,11 @@
* @return {me.PolyShape} new PolyShape
*/
clone : function() {
- return new me.PolyShape(this.pos.clone(), this.points, this.closed);
+ var copy = [];
+ this.points.forEach(function(point) {
+ copy.push(new me.Vector2d(point.x, point.y));
+ });
+ return new me.PolyShape(this.pos.clone(), copy, this.closed);
}, | Fixed the `clone()` function for me.polyShape
the array of points also need to be properly cloned | melonjs_melonJS | train | js |
1f0520e46ec132b0d81a65df94e41060e06349ff | diff --git a/src/main/java/javapns/communication/ConnectionToAppleServer.java b/src/main/java/javapns/communication/ConnectionToAppleServer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/javapns/communication/ConnectionToAppleServer.java
+++ b/src/main/java/javapns/communication/ConnectionToAppleServer.java
@@ -26,7 +26,7 @@ public abstract class ConnectionToAppleServer {
protected static final Logger logger = Logger.getLogger(ConnectionToAppleServer.class);
/* The algorithm used by KeyManagerFactory */
- private static final String ALGORITHM = "sunx509";
+ private static final String ALGORITHM = KeyManagerFactory.getDefaultAlgorithm();
/* The protocol used to create the SSLSocket */
private static final String PROTOCOL = "TLS"; | * fix to make trust store work on ibm jvm | fernandospr_javapns-jdk16 | train | java |
4b8ba008eeca3bfea09d8bea8918ffc5fb6f9386 | diff --git a/test/full.js b/test/full.js
index <HASH>..<HASH> 100644
--- a/test/full.js
+++ b/test/full.js
@@ -1101,7 +1101,7 @@ test('`state` properties', function (t) {
t.end();
});
-test.only('Issue: #75 `state` property from undefined -> state', function (t) {
+test('Issue: #75 `state` property from undefined -> state', function (t) {
t.plan(2);
var Person = State.extend({ | Fix test.only snafu | AmpersandJS_ampersand-state | train | js |
632f3c80550b39792cd1aed1eaf8a2e0d0332ae0 | diff --git a/userena/models.py b/userena/models.py
index <HASH>..<HASH> 100644
--- a/userena/models.py
+++ b/userena/models.py
@@ -308,7 +308,7 @@ class UserenaProfile(UserenaBaseProfile):
@property
def age(self):
- if not self.birth_date: return None
+ if not self.birth_date: return False
else:
today = datetime.date.today()
# Raised when birth date is February 29 and the current year is not a | Age property returns False when not filled in instead of None | bread-and-pepper_django-userena | train | py |
e8c445c3dfe9cd3adff751a5801dde4df974b8c7 | diff --git a/src/config/AutoConfig.php b/src/config/AutoConfig.php
index <HASH>..<HASH> 100644
--- a/src/config/AutoConfig.php
+++ b/src/config/AutoConfig.php
@@ -68,15 +68,9 @@ class AutoConfig extends Config {
if (CLI) $files[] = $configDir.'/config.cli.properties';
// user or environment config
- if ($configFile) {
- $files[] = $configFile;
- }
- else if (($env=getEnv('APP_ENV'))!==false || ($env=getEnv('APPLICATION_ENV'))!==false) {
- $files[] = $configDir.'/config.'.$env.'.properties';
- }
- else {
- $files[] = $configDir.'/config.properties';
- }
+ if ($configFile) $files[] = $configFile;
+ else if (($env=getEnv('APP_ENV')) !== false) $files[] = $configDir.'/config.'.$env.'.properties';
+ else $files[] = $configDir.'/config.properties';
}
// load config files | AutoConfig: use only APP_ENV for application environment configuration | rosasurfer_ministruts | train | php |
1039ebf907a4037b0da20fe7f08025ee2c0d189b | diff --git a/lib/steep/cli.rb b/lib/steep/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/steep/cli.rb
+++ b/lib/steep/cli.rb
@@ -112,8 +112,9 @@ module Steep
def process_project
Drivers::PrintProject.new(stdout: stdout, stderr: stderr).tap do |command|
- opts.banner = "Usage: steep project [options]"
OptionParser.new do |opts|
+ opts.banner = "Usage: steep project [options]"
+ opts.on("--steepfile=PATH") {|path| command.steepfile = Pathname(path) }
handle_logging_options opts
end.parse!(argv)
end.run | Let project command accept --steepfile option | soutaro_steep | train | rb |
76d05f171c025d15e63b73203ae963f715dd6bde | diff --git a/tasks/cucumber.js b/tasks/cucumber.js
index <HASH>..<HASH> 100644
--- a/tasks/cucumber.js
+++ b/tasks/cucumber.js
@@ -34,6 +34,10 @@ module.exports = function(grunt) {
var commands = [];
+ if (options.executeParallel && options.workers) {
+ commands.push('-w', options.workers);
+ }
+
if (options.steps) {
commands.push('-r', options.steps);
}
@@ -49,7 +53,10 @@ module.exports = function(grunt) {
}
if (options.format === 'html') {
- commands.push('-f', 'json');
+ if(options.executeParallel) {
+ commands.push('-f', 'json:' + options.output +'.json');
+ } else {
+ commands.push('-f', 'json');
} else {
commands.push('-f', options.format);
} | get number of workers for parallel execution
read json file generated from parallel-cucumber to generate the html report | mavdi_grunt-cucumberjs | train | js |
e1ffff433a0eced9853e361faa0c2b30a5a99fd9 | diff --git a/src/Util/Message/Serialization/MessageMappingRegistry.php b/src/Util/Message/Serialization/MessageMappingRegistry.php
index <HASH>..<HASH> 100644
--- a/src/Util/Message/Serialization/MessageMappingRegistry.php
+++ b/src/Util/Message/Serialization/MessageMappingRegistry.php
@@ -11,7 +11,7 @@ final class MessageMappingRegistry
$this->registry = $registry;
}
- public function execute(string $messageName): ?string
+ public function __invoke(string $messageName): ?string
{
if (\array_key_exists($messageName, $this->registry)) {
return $this->registry[$messageName]; | change method signature on messageMappingRegistry | PcComponentes_ddd | train | php |
63739638a41bdaa30f7a8ba13d54d9fa2d579f0b | diff --git a/src/GrumPHP/Locator/ChangedFiles.php b/src/GrumPHP/Locator/ChangedFiles.php
index <HASH>..<HASH> 100644
--- a/src/GrumPHP/Locator/ChangedFiles.php
+++ b/src/GrumPHP/Locator/ChangedFiles.php
@@ -34,7 +34,7 @@ class ChangedFiles implements LocatorInterface
*/
public function locate()
{
- $diff = $this->repository->getDiff('HEAD');
+ $diff = $this->repository->getWorkingCopy()->getDiffStaged();
$files = array();
/** @var File $file */
foreach ($diff->getFiles() as $file) { | Check only the files that are staged for commit | phpro_grumphp | train | php |
2c79e0ef3d93cd663fb06a341806fc06e4eb7279 | diff --git a/saltcloud/cli.py b/saltcloud/cli.py
index <HASH>..<HASH> 100644
--- a/saltcloud/cli.py
+++ b/saltcloud/cli.py
@@ -295,6 +295,8 @@ class SaltCloud(parsers.SaltCloudParser):
msg = 'There was a query error: {0}'
self.handle_exception(msg, exc)
+ else:
+ self.error('Nothing was done. Using the proper arguments?')
# display output using salt's outputter system
self.exit(0, '\n{0}'.format(self.display_output(ret))) | Error out if nothing was done, ie, wrong or erroneous arguments were passed. | saltstack_salt | train | py |
fff911b3160b12d786204005737f7f51ec0b9b83 | diff --git a/config/trustedproxy.php b/config/trustedproxy.php
index <HASH>..<HASH> 100644
--- a/config/trustedproxy.php
+++ b/config/trustedproxy.php
@@ -48,6 +48,8 @@ return [
'2405:b500::/32',
'2606:4700::/32',
'2803:f800::/32',
+ '2c0f:f248::/32',
+ '2a06:98c0::/29',
],
/* | Updated cloudflare ip list | CachetHQ_Cachet | train | php |
7793a7b54393f4a19e09a711f04fd8215be69456 | diff --git a/src/Base/AbstractApplication.php b/src/Base/AbstractApplication.php
index <HASH>..<HASH> 100644
--- a/src/Base/AbstractApplication.php
+++ b/src/Base/AbstractApplication.php
@@ -154,10 +154,8 @@ abstract class AbstractApplication implements ApplicationInterface
{
if ($this->myTempPath === null) {
// Generate a default temporary directory by document root.
- $tempPath = FilePath::parse(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'bluemvc' . DIRECTORY_SEPARATOR . sha1($this->myDocumentRoot->__toString()) . DIRECTORY_SEPARATOR);
- self::myEnsureDirectoryExists($tempPath);
-
- return $tempPath;
+ $this->myTempPath = FilePath::parse(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'bluemvc' . DIRECTORY_SEPARATOR . sha1($this->myDocumentRoot->__toString()) . DIRECTORY_SEPARATOR);
+ self::myEnsureDirectoryExists($this->myTempPath);
}
return $this->myTempPath; | Minor fix in getTempPath method in AbstractApplication | themichaelhall_bluemvc-core | train | php |
97848d57c992e125eae6ebcd5c25951c88e7a4ba | diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb
index <HASH>..<HASH> 100644
--- a/lib/cucumber/runtime.rb
+++ b/lib/cucumber/runtime.rb
@@ -216,7 +216,7 @@ module Cucumber
filters << Filters::TagLimits.new(tag_limits) if tag_limits.any?
filters << Cucumber::Core::Test::TagFilter.new(tag_expressions)
filters << Cucumber::Core::Test::NameFilter.new(name_regexps)
- filters << Cucumber::Core::Test::LocationFilter.new(filespecs.locations)
+ filters << Cucumber::Core::Test::LocationsFilter.new(filespecs.locations)
filters << Filters::Quit.new
filters << Filters::ActivateSteps.new(@support_code)
@configuration.filters.each do |filter| | Use the name LocationsFilter as cucumber-ruby-core does | cucumber_cucumber-ruby | train | rb |
e421842d8fd93edf74aba51732864d66ffeaff3b | diff --git a/autotest/la_tests.py b/autotest/la_tests.py
index <HASH>..<HASH> 100644
--- a/autotest/la_tests.py
+++ b/autotest/la_tests.py
@@ -346,7 +346,8 @@ def freyberg_verf_test():
post_pyemu = sc.posterior_parameter
diff = (post_pd7 - post_pyemu).to_dataframe()
diff = (diff / sc.pst.parameter_data.parval1 * 100.0).apply(np.abs)
- assert diff.max().max() < 1.0
+ print(diff.max().max())
+ assert diff.max().max() < 10.0
pd1_file = os.path.join(wdir,"predunc1_textable.dat")
names = ["forecasts","pd1_pr","py_pr","pd1_pt","py_pt"]
@@ -428,11 +429,11 @@ def alternative_dw():
if __name__ == "__main__":
#alternative_dw()
- #freyberg_verf_test()
+ freyberg_verf_test()
#forecast_pestpp_load_test()
#map_test()
#par_contrib_speed_test()
- schur_test()
+ #schur_test()
#par_contrib_test()
#dataworth_test()
#dataworth_next_test() | trying to diagnose travis freyberg la verf test fail | jtwhite79_pyemu | train | py |
04eef0909716c489866688af92b16672ab8acf6e | diff --git a/pyrogram/methods/messages/search_messages.py b/pyrogram/methods/messages/search_messages.py
index <HASH>..<HASH> 100644
--- a/pyrogram/methods/messages/search_messages.py
+++ b/pyrogram/methods/messages/search_messages.py
@@ -54,7 +54,7 @@ async def get_chunk(
sleep_threshold=60
)
- return await utils.parse_messages(client, r)
+ return await utils.parse_messages(client, r, replies=0)
class SearchMessages: | Don't fetch reply-to messages in search_messages | pyrogram_pyrogram | train | py |
55ec0bf7058babc1f8bc1de3783e179e68ce179b | diff --git a/neo4j-gremlin/src/test/java/com/tinkerpop/gremlin/neo4j/BaseNeo4jGraphTest.java b/neo4j-gremlin/src/test/java/com/tinkerpop/gremlin/neo4j/BaseNeo4jGraphTest.java
index <HASH>..<HASH> 100644
--- a/neo4j-gremlin/src/test/java/com/tinkerpop/gremlin/neo4j/BaseNeo4jGraphTest.java
+++ b/neo4j-gremlin/src/test/java/com/tinkerpop/gremlin/neo4j/BaseNeo4jGraphTest.java
@@ -1,5 +1,6 @@
package com.tinkerpop.gremlin.neo4j;
+import com.tinkerpop.gremlin.groovy.loaders.SugarLoader;
import com.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
import org.apache.commons.configuration.Configuration;
import org.junit.After;
@@ -24,6 +25,10 @@ public class BaseNeo4jGraphTest {
protected final DefaultNeo4jGraphProvider graphProvider = new DefaultNeo4jGraphProvider();
protected Neo4jGraph g;
+ static {
+ SugarLoader.load();
+ }
+
@Rule
public TestName name = new TestName(); | Load up more sugar in neo4j. | apache_tinkerpop | train | java |
27d0af9ef317ca5050f904f9e34b802f084a7905 | diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php
index <HASH>..<HASH> 100644
--- a/core/ArchiveProcessor/Rules.php
+++ b/core/ArchiveProcessor/Rules.php
@@ -69,7 +69,11 @@ class Rules
if ($segment->isEmpty() && ($periodLabel != 'range' || SettingsServer::isArchivePhpTriggered())) {
return true;
}
-
+
+ if ($periodLabel === 'range' && !SettingsServer::isArchivePhpTriggered()) {
+ return false;
+ }
+
return self::isSegmentPreProcessed($idSites, $segment);
} | When processing a dependent archive for a range, then only process the requested plugin, not all plugins (#<I>)
* try not report all plugin range
* Update Rules.php | matomo-org_matomo | train | php |
d29a400e46ca728ba2d35cb03b1e42e5f3ea5222 | diff --git a/lib/escher/version.rb b/lib/escher/version.rb
index <HASH>..<HASH> 100644
--- a/lib/escher/version.rb
+++ b/lib/escher/version.rb
@@ -1,3 +1,3 @@
module Escher
- VERSION = '0.2.1'
+ VERSION = '0.3.1'
end | Bump to the next version, <I> | emartech_escher-ruby | train | rb |
61a4d2796ddc508497dc5b2f95c5ca54975819e7 | diff --git a/proxy/proxy_test.go b/proxy/proxy_test.go
index <HASH>..<HASH> 100644
--- a/proxy/proxy_test.go
+++ b/proxy/proxy_test.go
@@ -20,6 +20,7 @@ import (
"code.cloudfoundry.org/diego-ssh/test_helpers"
"code.cloudfoundry.org/diego-ssh/test_helpers/fake_net"
"code.cloudfoundry.org/diego-ssh/test_helpers/fake_ssh"
+ loggregator "code.cloudfoundry.org/go-loggregator"
"code.cloudfoundry.org/lager"
"code.cloudfoundry.org/lager/lagertest"
fake_logs "github.com/cloudfoundry/dropsonde/log_sender/fake"
@@ -605,7 +606,7 @@ var _ = Describe("Proxy", func() {
metrics.Initialize(sender, nil)
metricChan = make(chan metric, 2)
- fakeMetronClient.SendMetricStub = func(name string, value int) error {
+ fakeMetronClient.SendMetricStub = func(name string, value int, opts ...loggregator.EmitGaugeOption) error {
metricChan <- metric{name: name, value: value}
return nil
} | fix some tests that were broken since SendMetric signature has changed
[#<I>] | cloudfoundry_diego-ssh | train | go |
e44a3bde77dbe6adce671894d04af1c4463445bb | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -269,7 +269,15 @@ module.exports = {
// that another extension must have forced to regenerate the index html or
// this is the first time this extension is running
var indexPath = path.join(config.directory, config.indexFile);
- var currentIndexHtml = fs.readFileSync(indexPath, 'utf8');
+
+ var currentIndexHtml;
+ try {
+ currentIndexHtml = fs.readFileSync(indexPath, 'utf8');
+ } catch (e) {
+ // no index file, we are done.
+ return;
+ }
+
if (!config.indexHtml.original) {
config.indexHtml.original = currentIndexHtml;
} | Fixed issue with index file that do not exist (test index file) | Esri_ember-cli-amd | train | js |
df883322c2db72126205c6832c238b66a50a0d2f | diff --git a/lib/workbook.js b/lib/workbook.js
index <HASH>..<HASH> 100644
--- a/lib/workbook.js
+++ b/lib/workbook.js
@@ -281,7 +281,7 @@ XlsxStreamReaderWorkBook.prototype._getSharedString = function(stringIndex){
var self = this;
if (stringIndex > self.workBookSharedStrings.length){
- self.emit('error',"missing shared string: " + stringIndex);
+ // self.emit('error',"missing shared string: " + stringIndex);
return;
}
return self.workBookSharedStrings[stringIndex]; | Do not emit error on missing shared string | DaSpawn_xlsx-stream-reader | train | js |
779b703b1cced91b24cc70364eeb470bd248f95c | diff --git a/src/main/java/com/relayrides/pushy/ApnsClientThread.java b/src/main/java/com/relayrides/pushy/ApnsClientThread.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/relayrides/pushy/ApnsClientThread.java
+++ b/src/main/java/com/relayrides/pushy/ApnsClientThread.java
@@ -44,9 +44,14 @@ public class ApnsClientThread<T extends ApnsPushNotification> extends Thread {
}
@Override
- public void run() {
+ public void start() {
this.state = State.CONNECT;
+ super.start();
+ }
+
+ @Override
+ public void run() {
while (this.state != State.EXIT) {
switch (this.state) {
case CONNECT: {
@@ -88,7 +93,7 @@ public class ApnsClientThread<T extends ApnsPushNotification> extends Thread {
case SHUTDOWN: {
try {
- if (this.channel.isOpen()) {
+ if (this.channel != null && this.channel.isOpen()) {
this.channel.close().sync();
}
@@ -101,9 +106,13 @@ public class ApnsClientThread<T extends ApnsPushNotification> extends Thread {
break;
}
- case EXIT:
- default: {
+ case EXIT: {
// Do nothing
+ break;
+ }
+
+ default: {
+ throw new IllegalArgumentException(String.format("Unexpected state: %S", this.getState()));
}
}
} | Minor cleanup and robustification in the client thread. | relayrides_pushy | train | java |
3e97bea38aab02b050452f223f69206e1a05fad0 | diff --git a/activesupport/test/core_ext/hash/transform_values_test.rb b/activesupport/test/core_ext/hash/transform_values_test.rb
index <HASH>..<HASH> 100644
--- a/activesupport/test/core_ext/hash/transform_values_test.rb
+++ b/activesupport/test/core_ext/hash/transform_values_test.rb
@@ -53,9 +53,21 @@ class TransformValuesTest < ActiveSupport::TestCase
assert_equal Enumerator, enumerator.class
end
+ test "transform_values! returns an Enumerator if no block is given" do
+ original = { a: 'a', b: 'b' }
+ enumerator = original.transform_values!
+ assert_equal Enumerator, enumerator.class
+ end
+
test "transform_values is chainable with Enumerable methods" do
original = { a: 'a', b: 'b' }
mapped = original.transform_values.with_index { |v, i| [v, i].join }
assert_equal({ a: 'a0', b: 'b1' }, mapped)
end
+
+ test "transform_values! is chainable with Enumerable methods" do
+ original = { a: 'a', b: 'b' }
+ original.transform_values!.with_index { |v, i| [v, i].join }
+ assert_equal({ a: 'a0', b: 'b1' }, original)
+ end
end | Added missing tests for transform_values! which returns Enumerator without blocks | rails_rails | train | rb |
b888326e80626472de9ed81254ade420385dbcb2 | diff --git a/app/models/adyen_notification.rb b/app/models/adyen_notification.rb
index <HASH>..<HASH> 100644
--- a/app/models/adyen_notification.rb
+++ b/app/models/adyen_notification.rb
@@ -21,7 +21,8 @@ class AdyenNotification < ActiveRecord::Base
"c_cash",
"directEbanking",
"trustly",
- "giropay"
+ "giropay",
+ "bcmc"
].freeze
AUTHORISATION = "AUTHORISATION".freeze | Add bcmc as auto capture only. It is a card payment but Adyen are changing their integration to only allow auto capture, so ¯\_(ツ)_/¯ | StemboltHQ_solidus-adyen | train | rb |
62cfa65b7c57fe2772b5366fb05f8bd6041e5b5c | diff --git a/lib/jammit/dependencies.rb b/lib/jammit/dependencies.rb
index <HASH>..<HASH> 100644
--- a/lib/jammit/dependencies.rb
+++ b/lib/jammit/dependencies.rb
@@ -11,6 +11,7 @@ require 'rubygems'
require 'yui/compressor'
require 'closure-compiler'
require 'active_support'
+require 'action_view'
# Load initial configuration before the rest of Jammit.
Jammit.load_configuration(Jammit::DEFAULT_CONFIG_PATH) if defined?(Rails)
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -6,7 +6,6 @@ RAILS_DEFAULT_LOGGER = Logger.new(devnull)
RAILS_ENV = "test"
RAILS_ROOT = File.expand_path('test')
-require 'action_view'
require 'lib/jammit'
gem 'rails'
require 'initializer' | action_view is now a real dependency, not just for tests | documentcloud_jammit | train | rb,rb |
84cdbddea3a40cf0be6549c3baefa997943e4983 | diff --git a/bcbio/bam/__init__.py b/bcbio/bam/__init__.py
index <HASH>..<HASH> 100644
--- a/bcbio/bam/__init__.py
+++ b/bcbio/bam/__init__.py
@@ -126,7 +126,9 @@ def downsample(in_bam, data, target_counts, read_filter="", always_run=False,
if not utils.file_exists(out_file):
with file_transaction(data, out_file) as tx_out_file:
sambamba = config_utils.get_program("sambamba", data["config"])
- num_cores = dd.get_num_cores(data)
+ # Avoid sambamba view segfaults with multiple cores
+ # num_cores = dd.get_num_cores(data)
+ num_cores = 1
cmd = ("{sambamba} view -t {num_cores} {read_filter} -f bam -o {tx_out_file} "
"--subsample={ds_pct:.3} --subsampling-seed=42 {in_bam}")
do.run(cmd.format(**locals()), "Downsample BAM file: %s" % os.path.basename(in_bam)) | Avoid sambamba view segfaults with multiple cores | bcbio_bcbio-nextgen | train | py |
b190fa342c66cf04397ae4a4bec1623f24493469 | diff --git a/uploadgedcom.php b/uploadgedcom.php
index <HASH>..<HASH> 100644
--- a/uploadgedcom.php
+++ b/uploadgedcom.php
@@ -881,6 +881,12 @@ if ($stage == 0) {
}
flush();
+// Importing generates 1000's of separate updates, and in auto-commit mode, each of these
+// is a separate transaction, which must be flushed to disk. This limits writes to approx
+// 100 per second (on a typical 6000 RPM disk).
+// By wrapping it all in one transaction, we only have one disk flush.
+WT_DB::exec("START TRANSACTION");
+
if ($stage == 1) {
@ set_time_limit($timelimit);
//-- make sure that we are working with the true time limit
@@ -1157,6 +1163,7 @@ if ($stage == 1) {
</form>
<?php
+WT_DB::exec("COMMIT");
print_footer();
?> | Bug #<I> - performance of import. (Testing with presidents.ged: before=<I> seconds, after=<I> seconds) | fisharebest_webtrees | train | php |
b20d2c8941f491e27d5a19bfa1a4ad1bb8aedeba | diff --git a/publisher/publisher.go b/publisher/publisher.go
index <HASH>..<HASH> 100644
--- a/publisher/publisher.go
+++ b/publisher/publisher.go
@@ -60,7 +60,8 @@ func listenContainers(client *docker.Client, etcdClient *etcd.Client, ttl time.D
if event.Status == "start" {
container, err := getContainer(client, event.ID)
if err != nil {
- log.Fatal(err)
+ log.Println(err)
+ continue
}
publishContainer(etcdClient, container, ttl)
} | fix(publisher): skip when failed to retrieve container
There is a race condition where a container starts via `docker run`,
but then immediately fails because an incorrect command was specified
or some other error occurred that caused the container to fail over. In
this case, we should just log and fail over, rather than killing
publisher. | deis_deis | train | go |
d75e792cc4b37cfd0606cd014d6d23d0b4d01ad8 | diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/RunCommand.php
+++ b/src/Command/RunCommand.php
@@ -10,7 +10,6 @@ namespace Deployer\Command;
use Deployer\Deployer;
use Deployer\Task\Context;
use Deployer\Task\Task;
-use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface as Input;
use Symfony\Component\Console\Input\InputOption as Option;
use Symfony\Component\Console\Output\OutputInterface as Output;
@@ -18,6 +17,7 @@ use function Deployer\cd;
use function Deployer\get;
use function Deployer\has;
use function Deployer\run;
+use function Deployer\test;
use function Deployer\writeln;
class RunCommand extends SelectCommand
@@ -58,7 +58,10 @@ class RunCommand extends SelectCommand
$task = new Task($command, function () use ($command) {
if (has('current_path')) {
- cd(get('current_path'));
+ $path = get('current_path');
+ if (test("[ -d $path ]")) {
+ cd($path);
+ }
}
$output = run($command);
writeln($output); | Check if current_path exist in run command | deployphp_deployer | train | php |
4151a7bf565a139f775d5dcba62337dc9b540d99 | diff --git a/openquake/hazardlib/site.py b/openquake/hazardlib/site.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/site.py
+++ b/openquake/hazardlib/site.py
@@ -129,7 +129,7 @@ site_param_dt = {
'z2pt5': numpy.float64,
'siteclass': (numpy.string_, 1),
'z1pt4': numpy.float64,
- 'backarc': numpy.uint8,
+ 'backarc': numpy.uint8, # 0=forearc,1=backarc,2=alongarc
'xvf': numpy.float64,
'soiltype': numpy.uint32,
'bas': numpy.bool, | Added comment [ci skip] | gem_oq-engine | train | py |
ce6a50c1014655594d37c3fa5d7ddf8bca6341df | diff --git a/activerecord/lib/active_record/scoping.rb b/activerecord/lib/active_record/scoping.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/scoping.rb
+++ b/activerecord/lib/active_record/scoping.rb
@@ -119,11 +119,12 @@ module ActiveRecord
return scope_type[model.name] if skip_inherited_scope
klass = model
base = model.base_class
- while klass <= base
+ while klass != base
value = scope_type[klass.name]
return value if value
klass = klass.superclass
end
+ scope_type[klass.name]
end
# Sets the +value+ for a given +scope_type+ and +model+. | Avoid using Module#<= in value_for
During where clause generation we search for scope type for the model.
We can do this with Module#!= instead as long as we grab the final scope type after the loop.
This is a small, but significant performance improvement. | rails_rails | train | rb |
caeaf6a2bf0c91c372357b8f665083bef7a6a869 | diff --git a/flask_resteasy.py b/flask_resteasy.py
index <HASH>..<HASH> 100644
--- a/flask_resteasy.py
+++ b/flask_resteasy.py
@@ -36,7 +36,7 @@ from flask.helpers import _endpoint_from_view_func
from werkzeug.wrappers import Response as ResponseBase
-__version__ = "0.0.3"
+__version__ = "0.0.3.1"
def unpack(rv): | Bump with <I>% test coverage. | jidn_flask-resteasy | train | py |
95d8f9cf8bf4b3760b76ba0e96bc0e1b059b0059 | diff --git a/lib/ar-find-in-batches-with-order.rb b/lib/ar-find-in-batches-with-order.rb
index <HASH>..<HASH> 100644
--- a/lib/ar-find-in-batches-with-order.rb
+++ b/lib/ar-find-in-batches-with-order.rb
@@ -14,7 +14,7 @@ module ActiveRecord
# try to deduct the property_key, but safer to specificy directly
property_key = options.delete(:property_key) || arel.orders.first.try(:value).try(:name) || arel.orders.first.try(:split,' ').try(:first)
- sanitized_key = ActiveRecord::Base.connection.quote_column_name(property_key)
+ sanitized_key = "#{quoted_table_name}.#{connection.quote_column_name(property_key)}"
relation = relation.limit(batch_size)
records = start ? (direction == :desc ? relation.where("#{sanitized_key} <= ?", start).to_a : relation.where("#{sanitized_key} >= ?", start).to_a) : relation.to_a | include quoted table name in sort key in case it is ambiguous with a join | nambrot_ar-find-in-batches-with-order | train | rb |
60bc549f16fa51d111cbcb016b4941061dc09b9d | diff --git a/commands.go b/commands.go
index <HASH>..<HASH> 100644
--- a/commands.go
+++ b/commands.go
@@ -33,7 +33,7 @@ var commandGet = cli.Command{
Name: "get",
Usage: "Clone/sync with a remote repository",
Description: `
- Clone a GitHub repository under ghq root direcotry. If the repository is
+ Clone a GitHub repository under ghq root directory. If the repository is
already cloned to local, nothing will happen unless '-u' ('--update')
flag is supplied, in which case 'git remote update' is executed.
When you use '-p' option, the repository is cloned via SSH. | fix typo direcotry -> directory | motemen_ghq | train | go |
8d1336a21517b351ae2cd90f4393c6e4b14ae935 | diff --git a/tests/engine2_test.py b/tests/engine2_test.py
index <HASH>..<HASH> 100644
--- a/tests/engine2_test.py
+++ b/tests/engine2_test.py
@@ -25,6 +25,7 @@ from django.core import exceptions
from openquake import engine2
from openquake.db import models
+from openquake.job import validation
from tests.utils import helpers
@@ -344,3 +345,20 @@ class CreateHazardJobProfileTestCase(unittest.TestCase):
self.assertEqual(hjp.investigation_time, 50.0)
self.assertEqual(hjp.truncation_level, 0.0)
self.assertEqual(hjp.maximum_distance, 200.0)
+
+
+class ReadJobProfileFromConfigFileTestCase(unittest.TestCase):
+ """Integration test for basic engine functions.
+
+ Test reading/generating a hazard job profile from a config file, then run
+ through the validation form.
+ """
+
+ def test_read_and_validate_hazard_config(self):
+ cfg = helpers.demo_file('simple_fault_demo_hazard/job.ini')
+ job = engine2.prepare_job(getpass.getuser())
+ params, files = engine2.parse_config(open(cfg, 'r'))
+ profile = engine2.create_hazard_job_profile(params, job.owner)
+
+ form = validation.ClassicalHazardJobForm(instance=profile, files=files)
+ self.assertTrue(form.is_valid()) | Added an integration test for loading and validating a job profile (read from a config file)
Former-commit-id: <I>c<I>f<I>bf0dd5e<I>e5de8bd6d<I>a | gem_oq-engine | train | py |
40676c1e526a36ced64dcc3b2b64e314a5ad5cb6 | diff --git a/programs/pmag_gui3.0.py b/programs/pmag_gui3.0.py
index <HASH>..<HASH> 100755
--- a/programs/pmag_gui3.0.py
+++ b/programs/pmag_gui3.0.py
@@ -366,6 +366,10 @@ class MagMainFrame(wx.Frame):
def on_convert_3(self, event):
fname = "magic_measurements.txt"
new_meas = pmag.convert2_3(fname, self.WD, self.WD)
+ self.contribution = nb.Contribution(self.WD)
+ self.contribution.propagate_measurement_info()
+ for table in self.contribution.tables:
+ self.contribution.tables[table].write_magic_file(dir_path=self.WD)
def on_er_data(self, event): | add propagate_measurement_info into pmag_gui | PmagPy_PmagPy | train | py |
c5fba53beda96111f03b232aedbdbb4a57e11d24 | diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js
@@ -104,7 +104,7 @@ define(['orion/webui/littlelib', 'orion/EventTarget'], function(lib, EventTarget
// if trigger node is not key enabled, then add key handler for ENTER, SPACE and DOWN arrow
if (this._triggerNode.tagName.toLowerCase() === "span") { //$NON-NLS-0$
this._triggerNode.addEventListener("keydown", function(event) { //$NON-NLS-0$
- if (event.keyCode === lib.KEY.ENTER || event.keyCode === lib.KEY.SPACE || event.keyCode === lib.KEY.DOWN) {
+ if (event.keyCode === lib.KEY.ENTER || event.keyCode === lib.KEY.SPACE) {
triggerClickHandler(event);
}
}.bind(this), false); | Fix regression: support for down arrow to activate find Options menu broke menubar menuitems. | eclipse_orion.client | train | js |
404a4d16e7169a3a1cbcc781021003233e4389b3 | diff --git a/aeron-client/src/main/java/io/aeron/Publication.java b/aeron-client/src/main/java/io/aeron/Publication.java
index <HASH>..<HASH> 100644
--- a/aeron-client/src/main/java/io/aeron/Publication.java
+++ b/aeron-client/src/main/java/io/aeron/Publication.java
@@ -43,7 +43,7 @@ import static io.aeron.protocol.DataHeaderFlyweight.HEADER_LENGTH;
public abstract class Publication implements AutoCloseable
{
/**
- * The publication is not yet connected to a subscriber.
+ * The publication is not connected to a subscriber, this can be an intermittent state as subscribers come and go.
*/
public static final long NOT_CONNECTED = -1; | [Java] Clarify javadoc for publication NOT_CONNECTED. | real-logic_aeron | train | java |
eba77ca20986cd77cc80a4270d9e8ccaedd73f8e | diff --git a/headers.js b/headers.js
index <HASH>..<HASH> 100644
--- a/headers.js
+++ b/headers.js
@@ -46,7 +46,7 @@ exports.social = {
}]
}
} else {
- file.warn(`no social profile for ${contrib.email}`, null, `${plugin}:social`)
+ file.info(`no social profile for ${contrib.email}`, null, `${plugin}:social`)
}
}
} | don't warn on missing social profile | remarkjs_remark-git-contributors | train | js |
c79a334c4f8bb79632ebd648a98542e3b247d15b | diff --git a/lib/opal/sprockets/processor.rb b/lib/opal/sprockets/processor.rb
index <HASH>..<HASH> 100644
--- a/lib/opal/sprockets/processor.rb
+++ b/lib/opal/sprockets/processor.rb
@@ -101,7 +101,7 @@ module Opal
# prerequired is mutated by the builder
dependencies = prerequired.uniq - stubbed_files.to_a
- dependencies.each { |asset| context.depend_on_asset(asset) }
+ dependencies.each { |asset| context.depend_on(asset) }
if self.class.source_map_enabled
$OPAL_SOURCE_MAPS[context.pathname] = '' #compiler.source_map(source_file_url(context)).to_s | #depend_on_asset was causing infinite loops | opal_opal | train | rb |
d529c40e250301a51e7471e18f1023a491948cfc | diff --git a/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java b/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java
+++ b/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java
@@ -154,9 +154,9 @@ public class ChannelManagerUpdatable
protected boolean needToUpdate()
{
return name.shouldUpdate()
- || topic.shouldUpdate()
- || userLimit.shouldUpdate()
- || bitrate.shouldUpdate();
+ || (topic != null && topic.shouldUpdate())
+ || (userLimit != null && userLimit.shouldUpdate())
+ || (bitrate != null && bitrate.shouldUpdate());
}
protected void checkPermission(Permission perm) | Fixed NPE due to not dealing with unused fields depending on channel type. | DV8FromTheWorld_JDA | train | java |
138aed3dddba4bee86f0ed80d1ce61575437eefa | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@ class PyTest(TestCommand):
setup(
name='pywb',
- version='0.9.0b',
+ version='0.9.0b1',
url='https://github.com/ikreymer/pywb',
author='Ilya Kreymer',
author_email='ikreymer@gmail.com', | change version to <I>b1 | webrecorder_pywb | train | py |
5c79a3a68a4ba1946bce6ed1b1aa76eae0e5f4c2 | diff --git a/client/js/bulkdelete_confirm.js b/client/js/bulkdelete_confirm.js
index <HASH>..<HASH> 100644
--- a/client/js/bulkdelete_confirm.js
+++ b/client/js/bulkdelete_confirm.js
@@ -4,7 +4,7 @@
/**
* force a confirm when clearing form submissions
*/
- $('#Root .bulkdelete_button').entwine({
+ $('#Form_EditForm .bulkdelete_button').entwine({
onclick: function(e) {
var button = $(e.target), | Make selector work in both ModelAdmin & CMS Page Ui | dnadesign_gridfield-bulk-delete | train | js |
d2140f335e23355be42bf4c2f740179a96509221 | diff --git a/webapps/webapp/src/main/webapp/app/tasklist/pages/task.js b/webapps/webapp/src/main/webapp/app/tasklist/pages/task.js
index <HASH>..<HASH> 100644
--- a/webapps/webapp/src/main/webapp/app/tasklist/pages/task.js
+++ b/webapps/webapp/src/main/webapp/app/tasklist/pages/task.js
@@ -93,7 +93,17 @@ ngDefine('tasklist.pages', [], function(module) {
return;
}
- var variablesMap = Forms.variablesToMap(variables);
+ // var variablesMap = Forms.variablesToMap(variables);
+ var variablesMap = {};
+ angular.forEach($scope.variablesForm, function(value, key) {
+ // if (key[0] !== '$' && !!value.$modelValue) {
+ if (key[0] !== '$') {
+ variablesMap[key] = {
+ // type:
+ value: value.$modelValue
+ };
+ }
+ });
var taskList = EngineApi.getTaskList(); | fix(tasklist): collect variables on task completion form | camunda_camunda-bpm-platform | train | js |
228a872c8d52c7a2d1f1d513e96c504232ea6105 | diff --git a/lib/gonzales.js b/lib/gonzales.js
index <HASH>..<HASH> 100644
--- a/lib/gonzales.js
+++ b/lib/gonzales.js
@@ -3,7 +3,7 @@ var parse = require('./parse');
module.exports = {
createNode: function(options) {
- return new Node(options.type, options.content);
+ return new Node(options);
},
parse: parse
}
diff --git a/lib/node.js b/lib/node.js
index <HASH>..<HASH> 100644
--- a/lib/node.js
+++ b/lib/node.js
@@ -8,14 +8,18 @@
function Node(options) {
this.type = options.type;
this.content = options.content;
- this.start = {
- line: options.start[0],
- column: options.start[1]
- };
- this.end = {
- line: options.end[0],
- column: options.end[1]
- };
+
+ if (options.start)
+ this.start = {
+ line: options.start[0],
+ column: options.start[1]
+ };
+
+ if (options.end)
+ this.end = {
+ line: options.end[0],
+ column: options.end[1]
+ };
}
Node.prototype = { | [node] Fix passing params to Node | tonyganch_gonzales-pe | train | js,js |
c3bb79dc46b6a51cd6ca116ca093f2729ddf294c | diff --git a/src/mongo/MongoTripodConfig.class.php b/src/mongo/MongoTripodConfig.class.php
index <HASH>..<HASH> 100644
--- a/src/mongo/MongoTripodConfig.class.php
+++ b/src/mongo/MongoTripodConfig.class.php
@@ -456,7 +456,7 @@ class MongoTripodConfig
{
throw new MongoTripodConfigException("Computed field spec contains more than one function");
}
- $this->validateComputedFieldSpec($functions[0], $field['value'][$functions[0]], $availableFields);
+ $this->validateComputedFieldSpec($functions[0], $field['value'], $availableFields);
}
} | Be consistent in computed field spec | talis_tripod-php | train | php |
703600e7df4d496c93e6f1cbfcf17dd0c1ee8f05 | diff --git a/hamster/stats.py b/hamster/stats.py
index <HASH>..<HASH> 100644
--- a/hamster/stats.py
+++ b/hamster/stats.py
@@ -69,7 +69,7 @@ class StatsViewer(object):
background = (0.975,0.975,0.975)
graph_frame.modify_bg(gtk.STATE_NORMAL,
- gtk.gdk.Color(*[b*65536.0 for b in background]))
+ gtk.gdk.Color(*[int(b*65536.0) for b in background])) | removed random warning
svn path=/trunk/; revision=<I> | projecthamster_hamster | train | py |
a949c427487de53503cfd5fce9b2e4af91eccd12 | diff --git a/adapter.go b/adapter.go
index <HASH>..<HASH> 100644
--- a/adapter.go
+++ b/adapter.go
@@ -77,7 +77,10 @@ func (adapter *Decoder) Decode(obj interface{}) error {
// More is there more?
func (adapter *Decoder) More() bool {
- return adapter.iter.head != adapter.iter.tail
+ if adapter.iter.head != adapter.iter.tail {
+ return true
+ }
+ return adapter.iter.loadMore()
}
// Buffered remaining buffer
diff --git a/api_tests/decoder_test.go b/api_tests/decoder_test.go
index <HASH>..<HASH> 100644
--- a/api_tests/decoder_test.go
+++ b/api_tests/decoder_test.go
@@ -56,3 +56,9 @@ func Test_use_number(t *testing.T) {
should.Nil(decoder2.Decode(&obj2))
should.Equal(json.Number("123"), obj2)
}
+
+func Test_decoder_more(t *testing.T) {
+ should := require.New(t)
+ decoder := jsoniter.NewDecoder(bytes.NewBufferString("abcde"))
+ should.True(decoder.More())
+}
\ No newline at end of file | fix #<I> should load from reader | json-iterator_go | train | go,go |
1ebe2fc5be8f261ae91ea7440d164f8956a4bf6d | diff --git a/credentials/credentials.go b/credentials/credentials.go
index <HASH>..<HASH> 100644
--- a/credentials/credentials.go
+++ b/credentials/credentials.go
@@ -99,8 +99,6 @@ type tlsCreds struct {
// GetRequestMetadata returns nil, nil since TLS credentials does not have
// metadata.
-// TODO(zhaoq): Define the set of the qualified keys instead of leaving it as an
-// arbitrary string.
func (c *tlsCreds) GetRequestMetadata(ctx context.Context) (map[string]string, error) {
return nil, nil
} | remove a TODO which is not needed | grpc_grpc-go | train | go |
d22dfdbb088f1be627d2636529641d74ed0d4fdd | diff --git a/tests/acceptance/admin/client/ContactInformationCest.php b/tests/acceptance/admin/client/ContactInformationCest.php
index <HASH>..<HASH> 100644
--- a/tests/acceptance/admin/client/ContactInformationCest.php
+++ b/tests/acceptance/admin/client/ContactInformationCest.php
@@ -35,7 +35,7 @@ class ContactInformationCest
[$key => 'social_net', 'text' => 'Social', 'td' => 'https://facebook.com/hipanel_test_admin'],
[$key => 'voice_phone', 'text' => 'Phone', 'td' => '380932003040'],
[$key => 'fax_phone', 'text' => 'Fax', 'td' => '380445203040'],
- [$key => 'street', 'text' => 'Street', 'td' => '42 Foo str.'],
+ [$key => 'street', 'text' => 'Address', 'td' => '42 Foo str.'],
[$key => 'city', 'text' => 'City', 'td' => 'Bar'],
[$key => 'province', 'text' => 'Province', 'td' => 'Kyiv'],
[$key => 'postal_code', 'text' => 'Postal code', 'td' => '01001'], | Changed test according to changed Street to Address | hiqdev_hipanel-module-client | train | php |
3177a489c03fd80a16a33c6a6d3a341fa0bf2742 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -58,7 +58,7 @@ export default function renderToString(vnode, context, opts, inner, isSvgMode) {
let pretty = opts.pretty,
indentChar = typeof pretty==='string' ? pretty : '\t';
- if (vnode==null || vnode===false) {
+ if (vnode==null || typeof vnode==='boolean') {
return '';
} | Skip `true` values as Preact does (#<I>) | developit_preact-render-to-string | train | js |
90d8d57798121f86c7246eb44e08dc3e98579cf1 | diff --git a/engine.py b/engine.py
index <HASH>..<HASH> 100644
--- a/engine.py
+++ b/engine.py
@@ -1,5 +1,5 @@
## This file is part of Invenio.
-## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
+## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
@@ -50,6 +50,9 @@ def acc_authorize_action(req, name_action, authorized_if_no_roles=False, batch_a
Returns (0, msg) when the authorization is granted, (1, msg) when it's not.
"""
from invenio.ext.login import UserInfo
+ from werkzeug.local import LocalProxy
+ if isinstance(req, LocalProxy):
+ req = req._get_current_object()
if isinstance(req, UserInfo):
user_info = req
uid = user_info.get_id() | access: fix edge cases of user info usage | inveniosoftware_invenio-access | train | py |
979c4afc8d6318d4951eb4ed688d40657c94ead7 | diff --git a/libs/remote_tools/filesystems/s3_filesystem.js b/libs/remote_tools/filesystems/s3_filesystem.js
index <HASH>..<HASH> 100644
--- a/libs/remote_tools/filesystems/s3_filesystem.js
+++ b/libs/remote_tools/filesystems/s3_filesystem.js
@@ -54,6 +54,8 @@ filesystem.prototype.upload = function (filename, path_to_file) {
filesystem.prototype.get_remote_url = function (filename, juicebox) {
if (enduro.config.s3.cloudfront && !juicebox) {
return 'https://' + enduro.config.s3.cloudfront + '/' + filename
+ } else if (enduro.config.s3.region === 'us-east-1') {
+ return 'https://s3.amazonaws.com/' + enduro.config.s3.bucket + '/' + filename
} else {
return 'https://s3-' + (enduro.config.s3.region || 'us-west-1') + '.amazonaws.com/' + enduro.config.s3.bucket + '/' + filename
} | filesystem s3 conditional for us-ease-1 | Gottwik_Enduro | train | js |
7707bc09860d0c8a732ec0e2db2cf86e8e4b006d | diff --git a/lib/analyze/webpagetest.js b/lib/analyze/webpagetest.js
index <HASH>..<HASH> 100644
--- a/lib/analyze/webpagetest.js
+++ b/lib/analyze/webpagetest.js
@@ -104,6 +104,11 @@ function analyzeUrl(args, asyncDoneCallback) {
return asyncDoneCallback(err);
}
+ if (!data.response) {
+ log.error('WebPageTest didn\'t deliver a response for url %s (%s)', url, data);
+ return asyncDoneCallback(new Error('No response from WPT.'));
+ }
+
var id = data.response.data.testId;
var har; | added extra check that WPT returns a response | sitespeedio_sitespeed.io | train | js |
cf6f8c817111e4adbaafee3fd61abfee613c258f | diff --git a/networking_cisco/plugins/cisco/n1kv/n1kv_neutron_plugin.py b/networking_cisco/plugins/cisco/n1kv/n1kv_neutron_plugin.py
index <HASH>..<HASH> 100644
--- a/networking_cisco/plugins/cisco/n1kv/n1kv_neutron_plugin.py
+++ b/networking_cisco/plugins/cisco/n1kv/n1kv_neutron_plugin.py
@@ -102,6 +102,7 @@ class N1kvNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
self.network_scheduler = importutils.import_object(
q_conf.CONF.network_scheduler_driver
)
+ self.start_periodic_dhcp_agent_status_check()
def _setup_rpc(self):
# RPC support | Add option to remove networks from dead DHCP agents
Networks are removed from dead agents after a certain
configurable time.
Then unhosted networks could be picked up by alive DHCP agents.
The feature is added for all plugins that support DHCP scheduling
DocImpact
Change-Id: I6ab<I>b<I>f<I>aa1d5de<I>d<I>c<I>f1cb<I>f1
Closes-Bug: #<I>
Cherry-picked from openstack/neutron | openstack_networking-cisco | train | py |
9fdd793bfac7de27e0029f8630062a69e3bc4036 | diff --git a/src/Exceptions/ExceptionHandler.php b/src/Exceptions/ExceptionHandler.php
index <HASH>..<HASH> 100644
--- a/src/Exceptions/ExceptionHandler.php
+++ b/src/Exceptions/ExceptionHandler.php
@@ -149,7 +149,7 @@ class ExceptionHandler extends BaseExceptionHandler
$model = $e->getModel();
$single = mb_strtolower(mb_substr($model, mb_strrpos($model, '\\') + 1));
$plural = Str::plural($single);
- preg_match("/".\Route::getPatterns()[$single]."/", $request->route($single), $matches);
+ preg_match('/'.\Route::getPatterns()[$single].'/', $request->route($single), $matches);
return intend([
'url' => Route::has("{$request->accessarea()}.{$plural}.index") ? route("{$request->accessarea()}.{$plural}.index") : route("{$request->accessarea()}.home"), | Apply fixes from StyleCI (#<I>) | rinvex_cortex-foundation | train | php |
600200a7a5dcc9deb257f97f966e52f358e8a82f | diff --git a/hotdoc/extensions/gst/gst_extension.py b/hotdoc/extensions/gst/gst_extension.py
index <HASH>..<HASH> 100644
--- a/hotdoc/extensions/gst/gst_extension.py
+++ b/hotdoc/extensions/gst/gst_extension.py
@@ -261,6 +261,7 @@ class GstPadTemplateSymbol(Symbol):
@end
@def content():
<div>
+ @symbol.formatted_doc
<pre class="language-yaml"><code class="language-yaml">@symbol.caps</code></pre>
<div class="symbol-detail">
<p><b>Presence</b> – <i>@symbol.presence</i></p>
@@ -826,7 +827,7 @@ class GstExtension(Extension):
for tname, template in templates.items():
name = tname.replace("%%", "%")
- unique_name = '%s->%s' % (element['hierarchy'][0], name)
+ unique_name = '%s!%s' % (element['hierarchy'][0], name)
object_type = self.__create_object_type(element, template.get("object-type"))
self.create_symbol(GstPadTemplateSymbol,
name=name, | gst: Render PadTemplate documentation
This was never possible, the symbol unique name is GTypeName->template_name | hotdoc_hotdoc | train | py |
204c914bc4d4bd0bb2076164074aec82b316f1c6 | diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftAPIGroups.java b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftAPIGroups.java
index <HASH>..<HASH> 100644
--- a/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftAPIGroups.java
+++ b/openshift-client/src/main/java/io/fabric8/openshift/client/OpenShiftAPIGroups.java
@@ -1,13 +1,12 @@
/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
+ * Copyright (C) 2015 Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | chore(license): fix license header
whoops IDEA you missed one! | fabric8io_kubernetes-client | train | java |
3552eef9972b6dda00b8aa3a6751235d81459166 | diff --git a/h2o-core/src/main/java/water/init/JarHash.java b/h2o-core/src/main/java/water/init/JarHash.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/init/JarHash.java
+++ b/h2o-core/src/main/java/water/init/JarHash.java
@@ -60,7 +60,9 @@ public abstract class JarHash {
private static final ArrayList<File> RESOURCE_FILES = new ArrayList<>();
public static void registerResourceRoot(File f) {
- RESOURCE_FILES.add(f);
+ if (f.exists()) {
+ RESOURCE_FILES.add(f);
+ }
}
// Look for resources (JS files, PNG's, etc) from the self-jar first, then
@@ -77,6 +79,9 @@ public abstract class JarHash {
if (is == null && (cl=Thread.currentThread().getContextClassLoader())!=null) {
is = loadResource(uri, cl);
}
+ if (is == null && (cl=JarHash.class.getClassLoader())!=null) {
+ is = loadResource(uri, cl);
+ }
if (is != null) return is;
// That failed, so try all registered locations
}
@@ -87,7 +92,7 @@ public abstract class JarHash {
}
} catch (FileNotFoundException ignore) {}
- Log.info("Resource not found: " + uri);
+ Log.warn("Resource not found: " + uri);
return null;
} | One more classloader to search classpath. | h2oai_h2o-3 | train | java |
696db4b48b3a3fdd9a3e5f5cb01c6095ea1cf630 | diff --git a/fireplace/cards/debug/all.py b/fireplace/cards/debug/all.py
index <HASH>..<HASH> 100644
--- a/fireplace/cards/debug/all.py
+++ b/fireplace/cards/debug/all.py
@@ -99,8 +99,7 @@ class XXX_019:
# Damage all but 1
class XXX_020:
- def play(self, target):
- return Hit(TARGET, target.health - 1)
+ play = SetCurrentHealth(TARGET, 1)
# Restore All Health | Change 'Damage all but 1' cheat card to SetCurrentHealth() | jleclanche_fireplace | train | py |
d011d776ce5826cce980ed89262bf5ae846fdbcd | diff --git a/modules/jpm-core/src/main/java/jpaoletti/jpm/core/operations/AddOperation.java b/modules/jpm-core/src/main/java/jpaoletti/jpm/core/operations/AddOperation.java
index <HASH>..<HASH> 100644
--- a/modules/jpm-core/src/main/java/jpaoletti/jpm/core/operations/AddOperation.java
+++ b/modules/jpm-core/src/main/java/jpaoletti/jpm/core/operations/AddOperation.java
@@ -20,7 +20,7 @@ public class AddOperation extends OperationCommandSupport {
return false;
} else {
if (ctx.getSelected() == null) {
- throw new PMException("pm.instance.not.found");
+ initBean(ctx); //Auto init bean
}
for (Field f : ctx.getEntity().getAllFields()) {
if (f.shouldDisplay(ctx.getOperation().getId())) { | Bean autoinitialization on add operation | jpaoletti_java-presentation-manager | train | java |
f4ddd91c212f0d2920aacf67bf95adcb2126c525 | diff --git a/src/test/java/one/util/streamex/MoreCollectorsTest.java b/src/test/java/one/util/streamex/MoreCollectorsTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/one/util/streamex/MoreCollectorsTest.java
+++ b/src/test/java/one/util/streamex/MoreCollectorsTest.java
@@ -220,6 +220,11 @@ public class MoreCollectorsTest {
checkShortCircuitCollector("head(10000)", IntStreamEx.rangeClosed(1, 10000).boxed().toList(), 10000,
() -> Stream.iterate(1, x -> x + 1), MoreCollectors.head(10000), true);
+
+ for (int size : new int[] { 1, 10, 20, 40, 60, 80, 90, 98, 99, 100 }) {
+ checkShortCircuitCollector("head-unordered-" + size, Collections.nCopies(size, "test"), size,
+ () -> StreamEx.constant("test", 100), MoreCollectors.head(size));
+ }
}
@Test | MoreCollectorsTest: test head in unordered mode | amaembo_streamex | train | java |
177736348b1ba3132af7059134f1755a1f7c931b | diff --git a/ev3dev/ev3.py b/ev3dev/ev3.py
index <HASH>..<HASH> 100644
--- a/ev3dev/ev3.py
+++ b/ev3dev/ev3.py
@@ -109,7 +109,7 @@ class Leds(object):
# ~autogen
-class Button(object):
+class Button(ButtonEVIO):
"""
EV3 Buttons
""" | Fix a bug introduced in #<I>
Some debug changes creeped into PR | ev3dev_ev3dev-lang-python | train | py |
4d077a1ca22b0a1638db3e29b735c45786a6eeaf | diff --git a/test/vagrant/vm_test.rb b/test/vagrant/vm_test.rb
index <HASH>..<HASH> 100644
--- a/test/vagrant/vm_test.rb
+++ b/test/vagrant/vm_test.rb
@@ -180,7 +180,7 @@ class VMTest < Test::Unit::TestCase
end
end
- context "reloading" do
+ context "reloading action" do
should "execute the reload action" do
@vm.expects(:execute!).with(Vagrant::Actions::VM::Reload).once
@vm.reload | Fixed issue with two tests being named the same (got rid of warning) | hashicorp_vagrant | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.