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
|
---|---|---|---|---|---|
0112adb304b5ef749a50e0e969768035c9d1d827 | diff --git a/hazelcast/src/main/java/com/hazelcast/query/PagingPredicate.java b/hazelcast/src/main/java/com/hazelcast/query/PagingPredicate.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/query/PagingPredicate.java
+++ b/hazelcast/src/main/java/com/hazelcast/query/PagingPredicate.java
@@ -48,7 +48,7 @@ public class PagingPredicate implements IndexAwarePredicate, DataSerializable {
}
public PagingPredicate(int pageSize) {
- if (pageSize <= 0){
+ if (pageSize <= 0) {
throw new IllegalArgumentException("pageSize should be greater than 0 !!!");
}
this.pageSize = pageSize;
@@ -121,6 +121,12 @@ public class PagingPredicate implements IndexAwarePredicate, DataSerializable {
}
}
+ public void reset() {
+ iterationType = null;
+ anchorMap.clear();
+ page = 0;
+ }
+
public void nextPage() {
page++;
} | added reset to PagingPredicate | hazelcast_hazelcast | train | java |
6771cd5a397b8581a7768a3cd088c160b86ba0f4 | diff --git a/src/app/Services/Options.php b/src/app/Services/Options.php
index <HASH>..<HASH> 100644
--- a/src/app/Services/Options.php
+++ b/src/app/Services/Options.php
@@ -170,8 +170,8 @@ class Options implements Responsable
private function get()
{
- return $this->selected
- ->merge($this->query->get());
+ return $this->query->get()
+ ->merge($this->selected);
}
private function isNested($attribute) | shows selected options on bottom in option list when searching | laravel-enso_Select | train | php |
eed83d46c72249611c0b3b8c62297ecb5b935c65 | diff --git a/web3/formatters.py b/web3/formatters.py
index <HASH>..<HASH> 100644
--- a/web3/formatters.py
+++ b/web3/formatters.py
@@ -5,30 +5,26 @@ import functools
import operator
from eth_utils import (
+ add_0x_prefix,
coerce_args_to_text,
coerce_return_to_text,
+ compose as _compose,
+ decode_hex,
+ encode_hex,
+ is_0x_prefixed,
is_address,
- is_string,
- is_integer,
- is_null,
is_dict,
- is_0x_prefixed,
- add_0x_prefix,
- encode_hex,
- decode_hex,
+ is_integer,
is_list_like,
+ is_null,
+ is_string,
to_normalized_address,
)
-'''
from cytoolz.functoolz import (
compose,
)
-'''
-from toolz.functoolz import (
- compose,
-)
from web3.iban import Iban
from web3.utils.datastructures import (
@@ -76,9 +72,11 @@ apply_if_integer = apply_if_passes_test(is_integer)
def apply_to_array(formatter_fn):
- return compose(
- list,
+ # workaround for https://github.com/pytoolz/cytoolz/issues/103
+ # NOTE: must reverse arguments when migrating from _compose to cytoolz.compose
+ return _compose(
functools.partial(map, formatter_fn),
+ list,
) | [issue <I>] add workaround for cytools.functoolz.compose issue #<I> | ethereum_web3.py | train | py |
67cb4c5320b7b2894f1ba31d38e937ac7c7c0e7d | diff --git a/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/HexSequence.java b/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/HexSequence.java
index <HASH>..<HASH> 100644
--- a/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/HexSequence.java
+++ b/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/HexSequence.java
@@ -73,7 +73,7 @@ public class HexSequence {
byte [] hex = new byte [len];
int pos = len - 1;
hex[pos--] = '\0';
- long n = i++;
+ long n = i;
while (n != 0) {
hex[pos--] = toHex(n & 0xf);
n >>>= 4;
@@ -81,6 +81,7 @@ public class HexSequence {
while (pos >= 0) {
hex[pos--] = '0';
}
+ i++;
return hex;
}
} | Move i++ into separate line for readability | reactiverse_reactive-pg-client | train | java |
e8552c666527ef32ecffcb7de596a4a6bee2163e | diff --git a/src/LinearAlgebra/DiagonalMatrix.php b/src/LinearAlgebra/DiagonalMatrix.php
index <HASH>..<HASH> 100644
--- a/src/LinearAlgebra/DiagonalMatrix.php
+++ b/src/LinearAlgebra/DiagonalMatrix.php
@@ -30,4 +30,9 @@ class DiagonalMatrix extends Matrix
}
$this->A = $A;
}
+
+ public function isSquare(): bool
+ {
+ return true;
+ }
}
diff --git a/tests/LinearAlgebra/DiagonalMatrixTest.php b/tests/LinearAlgebra/DiagonalMatrixTest.php
index <HASH>..<HASH> 100644
--- a/tests/LinearAlgebra/DiagonalMatrixTest.php
+++ b/tests/LinearAlgebra/DiagonalMatrixTest.php
@@ -34,6 +34,16 @@ class DiagonalMatrixTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($R, $D->getMatrix());
}
+ /**
+ * @dataProvider dataProviderMulti
+ */
+ public function testIsSquare(array $A, array $R)
+ {
+ $D = new DiagonalMatrix($A);
+
+ $this->assertTrue($D->isSquare());
+ }
+
public function dataProviderMulti()
{
return [ | Add isSquare to Diagonal Matrix. | markrogoyski_math-php | train | php,php |
afcec249b82cad60978e8ecb3926822d3f51b25a | diff --git a/src/main/java/org/primefaces/application/DialogNavigationHandler.java b/src/main/java/org/primefaces/application/DialogNavigationHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/application/DialogNavigationHandler.java
+++ b/src/main/java/org/primefaces/application/DialogNavigationHandler.java
@@ -84,7 +84,7 @@ public class DialogNavigationHandler extends ConfigurableNavigationHandler {
sb.append(optionName).append(":");
if (optionValue instanceof String) {
- sb.append("'").append(optionValue).append("'");
+ sb.append("'").append(ComponentUtils.escapeEcmaScriptText((String) optionValue)).append("'");
}
else {
sb.append(optionValue); | Fix #<I>: XSS in DialogFramework. | primefaces_primefaces | train | java |
f297313ca72da38fc97c2c52e73a844cb26f3b98 | diff --git a/spec/integration/decoder_spec.rb b/spec/integration/decoder_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/decoder_spec.rb
+++ b/spec/integration/decoder_spec.rb
@@ -21,6 +21,17 @@ describe Pocketsphinx::Decoder do
expect(subject.hypothesis).to eq("go forward ten meters")
end
+ # FIXME: This test illustrates a current issue discussed in:
+ # https://github.com/watsonbox/pocketsphinx-ruby/issues/10
+ it 'incorrectly decodes the speech in hello.wav on first attempt' do
+ hypotheses = (1..2).map do
+ subject.decode File.open('spec/assets/audio/hello.wav', 'rb')
+ subject.hypothesis
+ end
+
+ expect(hypotheses).to eq(['oh', 'hello'])
+ end
+
it 'accepts a file path as well as a stream' do
subject.decode 'spec/assets/audio/goforward.raw'
expect(subject.hypothesis).to eq("go forward ten meters") | Add test for undesirable decoding behavior on first hypothesis (see #<I>) | watsonbox_pocketsphinx-ruby | train | rb |
a02829ee15d1fe6421dec36855adaf1dd81c1a62 | diff --git a/tests/python/unittest/test_autograd.py b/tests/python/unittest/test_autograd.py
index <HASH>..<HASH> 100644
--- a/tests/python/unittest/test_autograd.py
+++ b/tests/python/unittest/test_autograd.py
@@ -383,6 +383,7 @@ def test_function():
@with_seed()
[email protected]_expected
def test_function1():
class Foo(mx.autograd.Function):
def __init__(self): | Mark test_function1 as garbage_expected (#<I>)
<URL> | apache_incubator-mxnet | train | py |
ed39e060fa1438b6aca96b3edb814de23ed6e456 | diff --git a/src/Graviton/SchemaBundle/Document/Schema.php b/src/Graviton/SchemaBundle/Document/Schema.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/SchemaBundle/Document/Schema.php
+++ b/src/Graviton/SchemaBundle/Document/Schema.php
@@ -147,13 +147,17 @@ class Schema
/**
* those are types that when they are required, a minimal length
- * shall be specified in schema
+ * shall be specified in schema (or allow null if not required; that will lead
+ * to the inclusion of "null" in the "type" property array)
*
* @var array
*/
protected $minLengthTypes = [
'integer',
'number',
+ 'float',
+ 'double',
+ 'decimal',
'string',
'date',
'extref' | also add minlength/null types to numeric types | libgraviton_graviton | train | php |
43f72713673078eb20ddc5800e62511f92fc0c5b | diff --git a/framework-extras/src/main/java/com/jetdrone/vertx/yoke/extras/engine/Jade4JEngine.java b/framework-extras/src/main/java/com/jetdrone/vertx/yoke/extras/engine/Jade4JEngine.java
index <HASH>..<HASH> 100644
--- a/framework-extras/src/main/java/com/jetdrone/vertx/yoke/extras/engine/Jade4JEngine.java
+++ b/framework-extras/src/main/java/com/jetdrone/vertx/yoke/extras/engine/Jade4JEngine.java
@@ -55,5 +55,12 @@ public class Jade4JEngine extends AbstractEngine<JadeTemplate> {
}
});
}
+
+ @Override
+ public void render(final String filename, final String layoutFilename, final Map<String, Object> context, final Handler<AsyncResult<Buffer>> next) {
+
+ // todo: implement proper layout support like in Groovy Template Engine
+
+ }
} | Update Jade4JEngine.java | pmlopes_yoke | train | java |
e157ed98bafd5167d7df4345be0647b81500f1e1 | diff --git a/kafka_tools/kafka_check/main.py b/kafka_tools/kafka_check/main.py
index <HASH>..<HASH> 100644
--- a/kafka_tools/kafka_check/main.py
+++ b/kafka_tools/kafka_check/main.py
@@ -65,18 +65,19 @@ def parse_args():
)
parser.add_argument(
"--broker-id",
- help='Kafka current broker id. If -1 then broker-id will be read from given --data-path',
+ help='Kafka current broker id.',
type=convert_to_broker_id,
)
parser.add_argument(
"--data-path",
- help='Path to the Kafka data folder. If specified --broker-id should be '
- 'given as -1.',
+ help='Path to the Kafka data folder.',
)
parser.add_argument(
'--controller-only',
action="store_true",
- help='If this parameter is specified, it will do nothing and succeed on non-controller brokers',
+ help='If this parameter is specified, it will do nothing and succeed on '
+ 'non-controller brokers. Set --broker-id to -1 to read broker-id from '
+ '--data-path.,
)
subparsers = parser.add_subparsers() | Change help for kafka-check | Yelp_kafka-utils | train | py |
52889764a205496e8c7c198206d9a1e080e7c5c8 | diff --git a/test/core.spec.js b/test/core.spec.js
index <HASH>..<HASH> 100644
--- a/test/core.spec.js
+++ b/test/core.spec.js
@@ -47,7 +47,8 @@ describe('core', () => {
it('should return attributes with parsed custom fields', () => {
let ddd = {title: 'Post', date: 'Nov 8, 2013'};
let result = core.parseCustomFields(ddd, {date: Date.parse});
- expect(result).to.eql({title: 'Post', date: 1383865200000});
+ expect(result.title).to.eql('Post');
+ expect((new Date(result.date)).toDateString()).to.eql('Fri Nov 08 2013');
});
});
diff --git a/test/helpers.spec.js b/test/helpers.spec.js
index <HASH>..<HASH> 100644
--- a/test/helpers.spec.js
+++ b/test/helpers.spec.js
@@ -200,7 +200,7 @@ describe('helpers', () => {
}
});
let result = func('file.txt');
- expect(result).to.eql('file.txt?1443126049000');
+ expect(result).to.match(/^file.txt\?\d{13}$/);
});
}); | Fix tests to work in different time zones. | sapegin_fledermaus | train | js,js |
24f59d9b90e634932e801870ade69e2fa6cd9a84 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -38,4 +38,6 @@ module.exports.levels.forEach(function (level) {
module.exports[level] = log.bind(null, module.exports, level);
});
+module.exports.log = log.bind(null, module.exports, 'info');
+
module.exports.default = module.exports; | Add log function for compatibility with Console API | megahertz_electron-log | train | js |
356e46ddb06a1c94fcd26aa6813ccec11235d166 | diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Eloquent/Model.php
+++ b/src/Illuminate/Database/Eloquent/Model.php
@@ -2548,7 +2548,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
// If the key already exists in the relationships array, it just means the
// relationship has already been loaded, so we'll just return it out of
// here because there is no need to query within the relations twice.
- if (array_key_exists($key, $this->relations))
+ if ($this->relationLoaded($key))
{
return $this->relations[$key];
}
@@ -3059,6 +3059,18 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
return $this->relations[$relation];
}
+
+ /**
+ * Check if the relation is loaded
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function relationLoaded($key)
+ {
+ return array_key_exists($key, $this->relations);
+ }
+
/**
* Set the specific relationship in the model.
* | Method to check if the relation is loaded | laravel_framework | train | php |
69d3fc9d7380012d3b9e9f3d0d69e782f6639ddd | diff --git a/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java b/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
index <HASH>..<HASH> 100755
--- a/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
+++ b/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java
@@ -54,7 +54,8 @@ public class BloatedAssignmentScope extends BytecodeScanningDetector {
dangerousAssignmentClassSources.add("java/io/InputStream");
dangerousAssignmentClassSources.add("java/io/ObjectInput");
dangerousAssignmentMethodSources.add("java/lang/System.currentTimeMillis()J");
- dangerousAssignmentMethodSources.add("java/util.Iterator.next()Ljava/lang/Object;");
+ dangerousAssignmentMethodSources.add("java/util/Iterator.next()Ljava/lang/Object;");
+ dangerousAssignmentMethodSources.add("java/util/regex/Matcher.start()I");
}
BugReporter bugReporter; | add Matcher.start as dangerous for BAS | mebigfatguy_fb-contrib | train | java |
f86486a4d86382a8677a35128f39a97507454ad5 | diff --git a/aws_google_auth/configuration.py b/aws_google_auth/configuration.py
index <HASH>..<HASH> 100644
--- a/aws_google_auth/configuration.py
+++ b/aws_google_auth/configuration.py
@@ -2,7 +2,10 @@
import os
import botocore.session
-import configparser
+try:
+ from backports import configparser
+except ImportError:
+ import configparser
from . import util
from . import amazon | Be explicit about which configparser (Issue #<I>) | cevoaustralia_aws-google-auth | train | py |
c1df667c7df98b7b4ba35055af232d9b8df04f3e | diff --git a/src/Matcher.php b/src/Matcher.php
index <HASH>..<HASH> 100644
--- a/src/Matcher.php
+++ b/src/Matcher.php
@@ -217,7 +217,7 @@ class Matcher extends AbstractMatcher implements Matchable
protected function isAnnotatedWith($class, $target, $annotationName)
{
if ($class instanceof \ReflectionMethod) {
- return $this->isAnnotatedWithReflectionMethod($target, $class, $annotationName);
+ return $this->isAnnotatedMethod($target, $class, $annotationName);
}
if ($target !== self::TARGET_CLASS) {
return $this->setAnnotations($class, $annotationName);
@@ -236,7 +236,7 @@ class Matcher extends AbstractMatcher implements Matchable
* @return array|bool
* @throws Exception\InvalidArgument
*/
- private function isAnnotatedWithReflectionMethod($target, $class, $annotationName)
+ private function isAnnotatedMethod($target, $class, $annotationName)
{
if ($target === self::TARGET_CLASS) {
throw new InvalidArgumentException($class->name); | change isAnnotatedMethod method name | ray-di_Ray.Aop | train | php |
a185e06e24dfaf18b78b3d1c51caaf44aed1d4d9 | diff --git a/owslib/util.py b/owslib/util.py
index <HASH>..<HASH> 100644
--- a/owslib/util.py
+++ b/owslib/util.py
@@ -251,9 +251,7 @@ def testXMLAttribute(element, attribute):
"""
if element is not None:
- attrib = element.get(attribute)
- if attrib is not None:
- return attrib.strip(' \t')
+ return element.get(attribute)
return None | Do not perform any strip in testXMLAttribute | geopython_OWSLib | train | py |
0b218bf147a5544eaa24c2b9546a5a9db5b526ca | diff --git a/ltiauthenticator/__init__.py b/ltiauthenticator/__init__.py
index <HASH>..<HASH> 100644
--- a/ltiauthenticator/__init__.py
+++ b/ltiauthenticator/__init__.py
@@ -131,9 +131,15 @@ class LTIAuthenticator(Authenticator):
for k, values in handler.request.body_arguments.items():
args[k] = values[0].decode() if len(values) == 1 else [v.decode() for v in values]
+ if 'x-forwarded-proto' in handler.request.headers and "https" in handler.request.headers['x-forwarded-proto']:
+ protocol = 'https'
+ else:
+ protocol = handler.request.protocol
+
+ launch_url = protocol + "://" + handler.request.host + handler.request.uri
if validator.validate_launch_request(
- handler.request.full_url(),
+ launch_url,
handler.request.headers,
args
): | Add support for forwarded protocol in headers (reverse_proxy) | jupyterhub_ltiauthenticator | train | py |
67d088583a150e505192d0998e61ed0eac939b7a | diff --git a/fdfgen/__init__.py b/fdfgen/__init__.py
index <HASH>..<HASH> 100644
--- a/fdfgen/__init__.py
+++ b/fdfgen/__init__.py
@@ -41,6 +41,8 @@ def handle_readonly(key, fields_readonly):
def handle_data_strings(fdf_data_strings, fields_hidden, fields_readonly):
+ if isinstance(fdf_data_strings, dict):
+ fdf_data_strings = list(fdf_data_strings.items())
for (key, value) in fdf_data_strings:
if isinstance(value, bool) and value:
value = b'/Yes' | Dictionary support for fields
Dictionaries seem like a more intuitive data type for handling field names, so gives users that option. | ccnmtl_fdfgen | train | py |
4df692eba9158b141a79fd83ee708d11c982d1e9 | diff --git a/public/js/content.js b/public/js/content.js
index <HASH>..<HASH> 100644
--- a/public/js/content.js
+++ b/public/js/content.js
@@ -72,8 +72,11 @@ apos.change = function(what) {
// Make sure we run scripts in the returned HTML
$('[data-apos-refreshable]').html($.parseHTML(data, document, true));
// Trigger the aposReady event so scripts can attach to the
- // elements just refreshed if needed
+ // elements just refreshed if needed. Also trigger apos.enablePlayers.
+ // Note that calls pushed by pushGlobalCalls are NOT run on a refresh as
+ // they generally have to do with one-time initialization of the page
$(function() {
+ apos.enablePlayers();
$("body").trigger("aposReady");
});
}); | Always run enablePlayers when refreshing the content area of the page | apostrophecms_apostrophe | train | js |
9bdd911943176ae26558407553ed4ac55004b8ed | diff --git a/tests/Http/HttpRequestTest.php b/tests/Http/HttpRequestTest.php
index <HASH>..<HASH> 100644
--- a/tests/Http/HttpRequestTest.php
+++ b/tests/Http/HttpRequestTest.php
@@ -405,6 +405,16 @@ class HttpRequestTest extends TestCase
$this->assertInstanceOf(SymfonyUploadedFile::class, $request['file']);
}
+ public function testBooleanMethod()
+ {
+ $request = Request::create('/', 'GET', ['with_trashed' => 'false', 'download' => true, 'checked' => 1, 'unchecked' => '0']);
+ $this->assertTrue($request->boolean('checked'));
+ $this->assertTrue($request->boolean('download'));
+ $this->assertFalse($request->boolean('unchecked'));
+ $this->assertFalse($request->boolean('with_trashed'));
+ $this->assertFalse($request->boolean('some_undefined_key'));
+ }
+
public function testArrayAccess()
{
$request = Request::create('/', 'GET', ['name' => null, 'foo' => ['bar' => null, 'baz' => '']]); | Update HttpRequestTest.php
Add tests for boolean method | laravel_framework | train | php |
5f694142fb7c93b2a3968551b6206835a94a5741 | diff --git a/jest.config.js b/jest.config.js
index <HASH>..<HASH> 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,4 +1,5 @@
module.exports = {
coverageDirectory: './coverage/',
- collectCoverage: true
+ collectCoverage: true,
+ collectCoverageFrom: ['src/**/*.js'],
}; | Collect coverage from js files in src | Botfuel_botfuel-dialog | train | js |
3b9c0a9a7bdebf003092206d9fb7c7e555685bf0 | diff --git a/src/RedirectException.php b/src/RedirectException.php
index <HASH>..<HASH> 100644
--- a/src/RedirectException.php
+++ b/src/RedirectException.php
@@ -39,6 +39,6 @@ class RedirectException extends Exception
}
Yii::$app->response->redirect(http_build_url($redirect_uri, [
'query' => http_build_query($query)
- ], HTTP_URL_REPLACE | HTTP_URL_JOIN_QUERY));
+ ], HTTP_URL_JOIN_QUERY));
}
} | Update RedirectException.php
HTTP_URL_REPLACE causes HTTP_URL_JOIN_QUERY to be completelly ignored and as such the $redirect_uri loses its original query parameters. | borodulin_yii2-oauth2-server | train | php |
6cd74907d93a705d12f23387823b33679abaa594 | diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/test_graphics.py
+++ b/pandas/tests/test_graphics.py
@@ -1865,11 +1865,11 @@ class TestDataFramePlots(TestPlotBase):
axes = _check_plot_works(df.plot, kind='box',
subplots=True, logy=True)
- self._check_axes_shape(axes, axes_num=3, layout=(1, 3))
- self._check_ax_scales(axes, yaxis='log')
- for ax, label in zip(axes, labels):
- self._check_text_labels(ax.get_xticklabels(), [label])
- self.assertEqual(len(ax.lines), self.bp_n_objects)
+ self._check_axes_shape(axes, axes_num=3, layout=(1, 3))
+ self._check_ax_scales(axes, yaxis='log')
+ for ax, label in zip(axes, labels):
+ self._check_text_labels(ax.get_xticklabels(), [label])
+ self.assertEqual(len(ax.lines), self.bp_n_objects)
axes = series.plot(kind='box', rot=40)
self._check_ticks_props(axes, xrot=40, yrot=0) | TST: test_box_plot on win > 3 fixed up | pandas-dev_pandas | train | py |
c679e9fef075c788a948f6337a57ad1312b078ba | diff --git a/lib/capybara-bootstrap-datepicker.rb b/lib/capybara-bootstrap-datepicker.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara-bootstrap-datepicker.rb
+++ b/lib/capybara-bootstrap-datepicker.rb
@@ -45,7 +45,7 @@ module Capybara
datepicker_years.find('.year', text: date.year).click
datepicker_months.find('.month', text: date.strftime("%b")).click
- datepicker_days.find('.day', text: date.day).click
+ datepicker_days.find(:xpath, ".//*[contains(concat(' ', @class, ' '), ' day ') and not(contains(concat(' ', @class, ' '), ' old ')) and not(contains(concat(' ', @class, ' '), ' new '))]", text: date.day).click
when :jquery
raise "jQuery UI datepicker support is not implemented."
else | fix day selection
use of xpath to avoid selection of old (past month) and new (next month)
days. So no more ambiguous day to click. | akarzim_capybara-bootstrap-datepicker | train | rb |
477444b11aed5607f52ae648c91d844fc98ca044 | diff --git a/archunit/src/main/java/com/tngtech/archunit/core/domain/AnnotationProxy.java b/archunit/src/main/java/com/tngtech/archunit/core/domain/AnnotationProxy.java
index <HASH>..<HASH> 100644
--- a/archunit/src/main/java/com/tngtech/archunit/core/domain/AnnotationProxy.java
+++ b/archunit/src/main/java/com/tngtech/archunit/core/domain/AnnotationProxy.java
@@ -188,7 +188,10 @@ class AnnotationProxy {
@Override
public Annotation convert(JavaAnnotation input, Class<?> returnType) {
- Class type = JavaType.From.javaClass(input.getType()).resolveClass(classLoader);
+ // JavaAnnotation#getType() will return the type name of a Class<? extends Annotation>
+ @SuppressWarnings("unchecked")
+ Class<? extends Annotation> type = (Class<? extends Annotation>)
+ JavaType.From.javaClass(input.getType()).resolveClass(classLoader);
return AnnotationProxy.of(type, input);
} | Ignore unsafe warning, since it's actually safe | TNG_ArchUnit | train | java |
39fbd550c4c8a4e5f3fe811312deb27d7c74d129 | diff --git a/packages/babel-core/src/helpers/normalize-ast.js b/packages/babel-core/src/helpers/normalize-ast.js
index <HASH>..<HASH> 100644
--- a/packages/babel-core/src/helpers/normalize-ast.js
+++ b/packages/babel-core/src/helpers/normalize-ast.js
@@ -7,9 +7,13 @@ import * as t from "babel-types";
*/
export default function (ast, comments, tokens) {
- if (ast && ast.type === "Program") {
- return t.file(ast, comments || [], tokens || []);
- } else {
- throw new Error("Not a valid ast?");
+ if (ast) {
+ if (ast.type === "Program") {
+ return t.file(ast, comments || [], tokens || []);
+ } else if (ast.type === "File") {
+ return ast;
+ }
}
+
+ throw new Error("Not a valid ast?");
} | also transforming of File asts | babel_babel | train | js |
e0bb04b82287565f33baa1dc4cdef8953000616e | diff --git a/builtin/providers/aws/resource_aws_security_group_rule_migrate_test.go b/builtin/providers/aws/resource_aws_security_group_rule_migrate_test.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_security_group_rule_migrate_test.go
+++ b/builtin/providers/aws/resource_aws_security_group_rule_migrate_test.go
@@ -27,7 +27,7 @@ func TestAWSSecurityGroupRuleMigrateState(t *testing.T) {
"from_port": "0",
"source_security_group_id": "sg-11877275",
},
- Expected: "sg-3766347571",
+ Expected: "sg-2889201120",
},
"v0_2": {
StateVersion: 0,
@@ -44,7 +44,7 @@ func TestAWSSecurityGroupRuleMigrateState(t *testing.T) {
"cidr_blocks.2": "172.16.3.0/24",
"cidr_blocks.3": "172.16.4.0/24",
"cidr_blocks.#": "4"},
- Expected: "sg-4100229787",
+ Expected: "sg-1826358977",
},
} | update expeded hash for migration test | hashicorp_terraform | train | go |
a50c66467e36bb33075cc61f141ae601f7a0ac49 | diff --git a/library/Imbo/Http/Request/Request.php b/library/Imbo/Http/Request/Request.php
index <HASH>..<HASH> 100644
--- a/library/Imbo/Http/Request/Request.php
+++ b/library/Imbo/Http/Request/Request.php
@@ -259,4 +259,19 @@ class Request extends SymfonyRequest {
public function getResource() {
return $this->resource;
}
+
+ /**
+ * Get the URI without the Symfony normalization applied to the query string
+ *
+ * @return string
+ */
+ public function getRawUri() {
+ $query = $this->server->get('QUERY_STRING');
+
+ if (!empty($query)) {
+ $query = '?' . $query;
+ }
+
+ return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getPathInfo() . $query;
+ }
} | Added a method for fetching the raw URI as Symfony normalizes the query string | imbo_imbo | train | php |
82952608a85bae65ba4252c6811845d39c963154 | diff --git a/tweetpony/api.py b/tweetpony/api.py
index <HASH>..<HASH> 100644
--- a/tweetpony/api.py
+++ b/tweetpony/api.py
@@ -177,7 +177,8 @@ class API(object):
except APIError:
raise
except:
- raise APIError(code = response.status_code, description = " ".join(response.headers['status'].split()[1:]))
+ description = " ".join(response.headers['status'].split()[1:]) if response.headers['status'] else "Unknown Error"
+ raise APIError(code = response.status_code, description = description)
if stream:
return response
if is_json: | Fixed an error while raising an exception if no HTTP status line is present | Mezgrman_TweetPony | train | py |
0ec92a48de7527e6292a60bc39ff973fbef402bf | diff --git a/aeron-archive/src/main/java/io/aeron/archive/RecordingFragmentReader.java b/aeron-archive/src/main/java/io/aeron/archive/RecordingFragmentReader.java
index <HASH>..<HASH> 100644
--- a/aeron-archive/src/main/java/io/aeron/archive/RecordingFragmentReader.java
+++ b/aeron-archive/src/main/java/io/aeron/archive/RecordingFragmentReader.java
@@ -125,11 +125,6 @@ class RecordingFragmentReader
return isDone;
}
- void isDone(final boolean isDone)
- {
- this.isDone = isDone;
- }
-
int controlledPoll(final SimpleFragmentHandler fragmentHandler, final int fragmentLimit)
{
if (isDone() || noAvailableData()) | [Java] Remove unused method. | real-logic_aeron | train | java |
7e7b050ae74db691de42e65aae35a5008aab95a2 | diff --git a/lib/pipeline/webpack.config.js b/lib/pipeline/webpack.config.js
index <HASH>..<HASH> 100644
--- a/lib/pipeline/webpack.config.js
+++ b/lib/pipeline/webpack.config.js
@@ -216,6 +216,10 @@ if (isTypeScriptEnabled) {
base.resolve.extensions.push('.ts', '.tsx');
}
+if (isFlowEnabled && isTypeScriptEnabled) {
+ throw new Error('isFlowEnabled and isTypeScriptEnabled cannot both be true');
+}
+
// development config
// ----------------------------------------------------------------------------- | raise exception if both Flow and TypeScript are enabled | embark-framework_embark | train | js |
19473ebb288d835943b719d440d1a3aaec53df3b | diff --git a/rebulk/match.py b/rebulk/match.py
index <HASH>..<HASH> 100644
--- a/rebulk/match.py
+++ b/rebulk/match.py
@@ -374,9 +374,9 @@ class _BaseMatches(MutableSequence):
ret = _BaseMatches._base()
for i in range(*match.span):
- ret.extend(self.starting(i))
- if i != match.span[0]:
- ret.extend(self.ending(i))
+ for at_match in self.at_index(i):
+ if at_match not in ret:
+ ret.append(at_match)
ret.remove(match) | Use better implementation for Matches conflicting method | Toilal_rebulk | train | py |
0eada538b25803d5570e6c08736221d5a2675360 | diff --git a/src/protean/adapters/repository/elasticsearch.py b/src/protean/adapters/repository/elasticsearch.py
index <HASH>..<HASH> 100644
--- a/src/protean/adapters/repository/elasticsearch.py
+++ b/src/protean/adapters/repository/elasticsearch.py
@@ -377,7 +377,12 @@ class ESProvider(BaseProvider):
def get_connection(self):
"""Get the connection object for the repository"""
- return Elasticsearch(self.conn_info["DATABASE_URI"]["hosts"])
+
+ return Elasticsearch(
+ self.conn_info["DATABASE_URI"]["hosts"],
+ use_ssl=self.conn_info.get("USE_SSL", True),
+ verify_certs=self.conn_info.get("VERIFY_CERTS", True),
+ )
def get_dao(self, entity_cls, model_cls):
"""Return a DAO object configured with a live connection""" | Fixes #<I> - Variable Parameters for ElasticSearch (#<I>) | proteanhq_protean | train | py |
553fba1fd12b570147b33d61716823affa7b7d17 | diff --git a/greenmail-core/src/test/java/com/icegreen/greenmail/test/ServerStartStopTest.java b/greenmail-core/src/test/java/com/icegreen/greenmail/test/ServerStartStopTest.java
index <HASH>..<HASH> 100644
--- a/greenmail-core/src/test/java/com/icegreen/greenmail/test/ServerStartStopTest.java
+++ b/greenmail-core/src/test/java/com/icegreen/greenmail/test/ServerStartStopTest.java
@@ -3,7 +3,6 @@ package com.icegreen.greenmail.test;
import com.icegreen.greenmail.util.GreenMail;
import com.icegreen.greenmail.util.ServerSetup;
import com.icegreen.greenmail.util.ServerSetupTest;
-import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
@@ -14,7 +13,6 @@ import static org.junit.Assert.fail;
*/
public class ServerStartStopTest {
@Test
- @Ignore
public void testStartStop() {
GreenMail service = new GreenMail(ServerSetupTest.ALL);
try {
@@ -33,7 +31,6 @@ public class ServerStartStopTest {
}
@Test
- @Ignore
public void testServerStartupTimeout() {
// Create a few setups
ServerSetup setups[] = ServerSetupTest.ALL; | Remove ignore. Didn't help | greenmail-mail-test_greenmail | train | java |
d3afa0c3b5211db2b70afc55c3961ba0174e4559 | diff --git a/src/Forms/DateField.php b/src/Forms/DateField.php
index <HASH>..<HASH> 100644
--- a/src/Forms/DateField.php
+++ b/src/Forms/DateField.php
@@ -338,10 +338,6 @@ class DateField extends TextField
return $this;
}
- if (is_array($value)) {
- throw new InvalidArgumentException("Use setSubmittedValue to assign by array");
- }
-
// Re-run through formatter to tidy up (e.g. remove time component)
$this->value = $this->tidyISO8601($value);
return $this;
diff --git a/src/Forms/DatetimeField.php b/src/Forms/DatetimeField.php
index <HASH>..<HASH> 100644
--- a/src/Forms/DatetimeField.php
+++ b/src/Forms/DatetimeField.php
@@ -349,9 +349,6 @@ class DatetimeField extends TextField
$this->value = null;
return $this;
}
- if (is_array($value)) {
- throw new InvalidArgumentException("Use setSubmittedValue to assign by array");
- };
// Validate iso 8601 date
// If invalid, assign for later validation failure | Remove array check since setSubmittedValue() no longer supports it | silverstripe_silverstripe-framework | train | php,php |
1925db1a4220f9b66af92aebb5105aca4f5fde2e | diff --git a/cassiopeia/datastores/merakianalyticscdn.py b/cassiopeia/datastores/merakianalyticscdn.py
index <HASH>..<HASH> 100644
--- a/cassiopeia/datastores/merakianalyticscdn.py
+++ b/cassiopeia/datastores/merakianalyticscdn.py
@@ -9,6 +9,7 @@ try:
import ujson as json
except ImportError:
import json
+ json.decode = json.loads
T = TypeVar("T") | added json.decode method for builtin json package | meraki-analytics_cassiopeia | train | py |
e75297ca4d4f10d5656d120b0d5dd1abe94d7b25 | diff --git a/src/foremast/utils/templates.py b/src/foremast/utils/templates.py
index <HASH>..<HASH> 100644
--- a/src/foremast/utils/templates.py
+++ b/src/foremast/utils/templates.py
@@ -52,9 +52,10 @@ def get_template_object(template_file=''):
try:
template = jinjaenv.get_template(template_file)
except jinja2.TemplateNotFound:
- LOG.debug("Unable to find template %s in specified template path %s", template_file, TEMPLATES_PATH)
- raise ForemastTemplateNotFound("Unable to find template %s in specified template path %s", template_file,
- TEMPLATES_PATH)
+ message = 'Unable to find template "{template_file}" in paths {paths}'.format(
+ template_file=template_file, paths=jinjaenv.loader.searchpath)
+ LOG.error(message)
+ raise ForemastTemplateNotFound(message)
return template | fix: Better ERROR when template not found | foremast_foremast | train | py |
6c3757c5fc7f716bf19b87eb33f76c4e0a5b8f08 | diff --git a/src/wa_kat/analyzers/source_string.py b/src/wa_kat/analyzers/source_string.py
index <HASH>..<HASH> 100755
--- a/src/wa_kat/analyzers/source_string.py
+++ b/src/wa_kat/analyzers/source_string.py
@@ -33,6 +33,9 @@ class SourceString(str):
return "%s:%s" % (self.source, self.val)
def to_dict(self):
+ """
+ Convert yourself to dict.
+ """
return {
"val": self.val,
"source": self.source, | #<I>: Added docstrings to source_string.py. | WebarchivCZ_WA-KAT | train | py |
1d4d33dfc7b8614619502c636113e5b7dec4e508 | diff --git a/src/QueryBuilder/TokenSequencer.php b/src/QueryBuilder/TokenSequencer.php
index <HASH>..<HASH> 100644
--- a/src/QueryBuilder/TokenSequencer.php
+++ b/src/QueryBuilder/TokenSequencer.php
@@ -4,7 +4,7 @@ namespace Silktide\Reposition\QueryBuilder;
use Silktide\Reposition\QueryBuilder\QueryToken\TokenFactory;
use Silktide\Reposition\QueryBuilder\QueryToken\Token;
-use Silktide\Reposition\Exception\TokenParseExcaptoin;
+use Silktide\Reposition\Exception\TokenParseException;
use Silktide\Reposition\Metadata\EntityMetadata;
class TokenSequencer implements TokenSequencerInterface
@@ -157,7 +157,7 @@ class TokenSequencer implements TokenSequencerInterface
}
$parentMetadata = $this->includes[$parent];
if ($parent == $parentMetadata->getEntity()) {
- $parent = $parentMetadata->getCollections();
+ $parent = $parentMetadata->getCollection();
}
}
@@ -263,6 +263,7 @@ class TokenSequencer implements TokenSequencerInterface
}
$this->addNewToSequence("join");
$this->addNewToSequence("collection", $collection, $collectionAlias);
+ $this->addNewToSequence("on");
$this->closure($on);
$this->joinedTables[$alias] = true; | correct spelling of TokenParseException
use correct method name for getCollection()
insert an "on" token when creating a join | lexide_reposition | train | php |
41d134fadbb64f99cd412832f5a569b3fffc40fd | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -29,7 +29,7 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = about['__title__']
+project = 'Resolwe'
version = about['__version__']
release = version
author = about['__author__']
diff --git a/resolwe/__about__.py b/resolwe/__about__.py
index <HASH>..<HASH> 100644
--- a/resolwe/__about__.py
+++ b/resolwe/__about__.py
@@ -2,7 +2,7 @@
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
-__title__ = 'Resolwe'
+__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/resolwe' | Make project name 'resolwe', but keep 'Resolwe' for documentation | genialis_resolwe | train | py,py |
ab37aec1c29282f9d5a9b0f7354aa7bcdb864fa3 | diff --git a/lib/generators/shopify_app/shopify_app_generator.rb b/lib/generators/shopify_app/shopify_app_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/shopify_app/shopify_app_generator.rb
+++ b/lib/generators/shopify_app/shopify_app_generator.rb
@@ -2,8 +2,13 @@ module ShopifyApp
module Generators
class ShopifyAppGenerator < Rails::Generators::Base
+ def initialize(args, *options)
+ @opts = options.first
+ super(args, *options)
+ end
+
def run_all_generators
- generate "shopify_app:install"
+ generate "shopify_app:install #{@opts.join(' ')}"
generate "shopify_app:shop_model"
generate "shopify_app:controllers" | passes the options through to the install generator | Shopify_shopify_app | train | rb |
76e70dc3ec2d7285f359de4896f75f230de1377f | diff --git a/src/locale/bootstrap-table-en-US.js b/src/locale/bootstrap-table-en-US.js
index <HASH>..<HASH> 100644
--- a/src/locale/bootstrap-table-en-US.js
+++ b/src/locale/bootstrap-table-en-US.js
@@ -10,7 +10,7 @@
return 'Loading, please wait...';
},
formatRecordsPerPage: function (pageNumber) {
- return pageNumber + ' records per page';
+ return pageNumber + ' rows per page';
},
formatShowingRows: function (pageFrom, pageTo, totalRows) {
return 'Showing ' + pageFrom + ' to ' + pageTo + ' of ' + totalRows + ' rows';
@@ -40,4 +40,4 @@
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US']);
-})(jQuery);
\ No newline at end of file
+})(jQuery); | 'records' to 'rows', as per #<I>
#<I> | wenzhixin_bootstrap-table | train | js |
a3c536b5df901b08c8287f6d1889ab69bf911725 | diff --git a/hug/types.py b/hug/types.py
index <HASH>..<HASH> 100644
--- a/hug/types.py
+++ b/hug/types.py
@@ -125,3 +125,18 @@ def json(value):
raise ValueError('Incorrectly formatted JSON provided')
else:
return value
+
+
+def multi(*types):
+ '''Enables accepting one of multiple type methods'''
+ type_strings = (type_method.__doc__ for type_method in types)
+ doc_string = 'Accepts any of the following value types:{0}\n'.format('\n - '.join(type_strings))
+ def multi_type(value):
+ for type_method in types:
+ try:
+ return type_method(value)
+ except:
+ pass
+ raise ValueError(doc_string)
+ multi_type.__doc__ = doc_string
+ return multi_type | Implement multi-type support in accordance with changelog and test definition | hugapi_hug | train | py |
22f258ffaf33b3988845839b06a728dd10475550 | diff --git a/pandas/core/index.py b/pandas/core/index.py
index <HASH>..<HASH> 100644
--- a/pandas/core/index.py
+++ b/pandas/core/index.py
@@ -1487,7 +1487,10 @@ class MultiIndex(Index):
return len(self.labels[0])
def to_native_types(self, slicer=None, na_rep='', float_format=None):
- return self.tolist()
+ ix = self
+ if slicer:
+ ix = self[slicer]
+ return ix.tolist()
@property
def _constructor(self): | BUG: MultiIndex to_native_types did not obey slicer | pandas-dev_pandas | train | py |
c3058dbdb6ac7dbe65644c32f6946164f27826e8 | diff --git a/src/system/modules/metamodelsattribute_timestamp/config/config.php b/src/system/modules/metamodelsattribute_timestamp/config/config.php
index <HASH>..<HASH> 100644
--- a/src/system/modules/metamodelsattribute_timestamp/config/config.php
+++ b/src/system/modules/metamodelsattribute_timestamp/config/config.php
@@ -16,7 +16,5 @@
* @filesource
*/
-$GLOBALS['METAMODELS']['attributes']['timestamp'] = array(
- 'class' => 'MetaModelAttributeTimestamp',
- 'image' => 'system/modules/metamodelsattribute_timestamp/html/timestamp.png'
-);
\ No newline at end of file
+$GLOBALS['METAMODELS']['attributes']['timestamp']['class'] = 'MetaModelAttributeTimestamp';
+$GLOBALS['METAMODELS']['attributes']['timestamp']['image'] = 'system/modules/metamodelsattribute_timestamp/html/timestamp.png';
\ No newline at end of file | The config now does "deep assignments"
See <URL> | MetaModels_attribute_timestamp | train | php |
3c65840a4afcb67520ad0f6c6db83221cf345116 | diff --git a/core/lib/refinery/engine.rb b/core/lib/refinery/engine.rb
index <HASH>..<HASH> 100644
--- a/core/lib/refinery/engine.rb
+++ b/core/lib/refinery/engine.rb
@@ -17,6 +17,7 @@ module Refinery
# module Refinery
# module Images
# class Engine < Rails::Engine
+ # include Refinery::Engine
# engine_name :images
#
# after_inclusion do
@@ -45,6 +46,7 @@ module Refinery
# module Refinery
# module Images
# class Engine < Rails::Engine
+ # include Refinery::Engine
# engine_name :images
#
# before_inclusion do | Updated docs to reflect including Refinery::Engine | refinery_refinerycms | train | rb |
1b64550341dbeea3ce9f1768d8dd374ce6bce4ea | diff --git a/src/js/components/SkipLinks.js b/src/js/components/SkipLinks.js
index <HASH>..<HASH> 100644
--- a/src/js/components/SkipLinks.js
+++ b/src/js/components/SkipLinks.js
@@ -10,7 +10,7 @@ var SkipLinks = React.createClass({
mixins: [IntlMixin],
- componentDidMount: function () {
+ _updateAnchors: function () {
var anchorElements = document.querySelectorAll('[data-skip-label]');
var anchors = Array.prototype.map.call(anchorElements, function (anchorElement) {
@@ -23,6 +23,21 @@ var SkipLinks = React.createClass({
this.setState({anchors: anchors});
},
+ componentDidMount: function () {
+ this._updateAnchors();
+ },
+
+ componentWillReceiveProps: function (newProps) {
+ this.setState({routeChanged: true});
+ },
+
+ componentDidUpdate: function () {
+ if (this.state.routeChanged) {
+ this._updateAnchors();
+ this.setState({routeChanged: false});
+ }
+ },
+
getInitialState: function () {
return {anchors: [], showLayer: false};
}, | Updating SkipLinks when changing route. | grommet_grommet | train | js |
b6af321b38827f26639c127ddeb8d34b50f2b3c1 | diff --git a/rxjava-core/src/main/java/rx/schedulers/CachedThreadScheduler.java b/rxjava-core/src/main/java/rx/schedulers/CachedThreadScheduler.java
index <HASH>..<HASH> 100644
--- a/rxjava-core/src/main/java/rx/schedulers/CachedThreadScheduler.java
+++ b/rxjava-core/src/main/java/rx/schedulers/CachedThreadScheduler.java
@@ -25,7 +25,7 @@ import java.util.Iterator;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-/* package */class CachedThreadScheduler extends Scheduler {
+/* package */final class CachedThreadScheduler extends Scheduler {
private static final String WORKER_THREAD_NAME_PREFIX = "RxCachedThreadScheduler-";
private static final NewThreadScheduler.RxThreadFactory WORKER_THREAD_FACTORY =
new NewThreadScheduler.RxThreadFactory(WORKER_THREAD_NAME_PREFIX);
@@ -106,7 +106,7 @@ import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
return new EventLoopWorker(CachedWorkerPool.INSTANCE.get());
}
- private static class EventLoopWorker extends Scheduler.Worker {
+ private static final class EventLoopWorker extends Scheduler.Worker {
private final CompositeSubscription innerSubscription = new CompositeSubscription();
private final ThreadWorker threadWorker;
volatile int once; | Declare Scheduler classes in CachedThreadScheduler as final | ReactiveX_RxJava | train | java |
0208c210c6f58684f3cf48526fb967eacbefae33 | diff --git a/src/test/java/org/lmdbjava/DbiTest.java b/src/test/java/org/lmdbjava/DbiTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/lmdbjava/DbiTest.java
+++ b/src/test/java/org/lmdbjava/DbiTest.java
@@ -187,7 +187,13 @@ public class DbiTest {
public void testMapFullException() {
final Dbi<ByteBuffer> db = env.openDbi(DB_1, MDB_CREATE);
try (final Txn<ByteBuffer> txn = env.txnWrite()) {
- final ByteBuffer v = allocateDirect(1_024 * 1_024 * 1_024);
+ final ByteBuffer v;
+ try {
+ v = allocateDirect(1_024 * 1_024 * 1_024);
+ } catch (OutOfMemoryError ome) {
+ // Travis CI OS X build cannot allocate this much memory, so assume OK
+ throw new MapFullException();
+ }
db.put(txn, bb(1), v);
}
} | Handle Travis CI out of memory on OS X | lmdbjava_lmdbjava | train | java |
b8bd63ace2b73dbbf576a3a97ef73c80ada48271 | diff --git a/core/src/java/main/org/uncommons/maths/random/DevRandomSeedGenerator.java b/core/src/java/main/org/uncommons/maths/random/DevRandomSeedGenerator.java
index <HASH>..<HASH> 100644
--- a/core/src/java/main/org/uncommons/maths/random/DevRandomSeedGenerator.java
+++ b/core/src/java/main/org/uncommons/maths/random/DevRandomSeedGenerator.java
@@ -27,7 +27,7 @@ import java.io.IOException;
*/
public class DevRandomSeedGenerator implements SeedGenerator
{
- private static final File DEV_RANDOM = new File("/dev/urandom");
+ private static final File DEV_RANDOM = new File("/dev/random");
/**
* {@inheritDoc} | Reverted unintentional commit. | dwdyer_uncommons-maths | train | java |
e47649fd37059d869b866d776ac9d3b94d456174 | diff --git a/relay_request.js b/relay_request.js
index <HASH>..<HASH> 100644
--- a/relay_request.js
+++ b/relay_request.js
@@ -226,10 +226,6 @@ RelayRequest.prototype.logError = function logError(err, codeName) {
var level = errorLogLevel(err, codeName);
- if (level === 'error' && err.isErrorFrame) {
- level = 'warn';
- }
-
var logger = self.channel.logger;
var logOptions = {
error: err,
@@ -259,6 +255,9 @@ function errorLogLevel(err, codeName) {
switch (codeName) {
case 'ProtocolError':
case 'UnexpectedError':
+ if (err.isErrorFrame) {
+ return 'warn';
+ }
return 'error';
case 'NetworkError': | RelayRequest: refactor error frame warn level logic | uber_tchannel-node | train | js |
ea0640ade99c8e3c8838fc0175c0b5fa4934f27f | diff --git a/warehouse/static/js/main.js b/warehouse/static/js/main.js
index <HASH>..<HASH> 100644
--- a/warehouse/static/js/main.js
+++ b/warehouse/static/js/main.js
@@ -11,7 +11,7 @@ $(document).ready(function() {
// Toggle accordion
$(".-js-accordion-trigger").click(function(){
- $(this).closest('.accordion').toggleClass("accordion--closed");
+ $(this).closest(".accordion").toggleClass("accordion--closed");
});
function setTab(tab) { | Update JS to conform with linter | pypa_warehouse | train | js |
c727444880b5fc7e63493cc46fec6063e7b347f7 | diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Console/Shell.php
+++ b/lib/Cake/Console/Shell.php
@@ -372,7 +372,9 @@ class Shell extends Object {
if (!empty($this->params['quiet'])) {
$this->_useLogger(false);
}
-
+ if (!empty($this->params['plugin'])) {
+ CakePlugin::load($this->params['plugin']);
+ }
$this->command = $command;
if (!empty($this->params['help'])) {
return $this->_displayHelp($command); | Fix behavior of --plugin param
Since plugins are not loaded in bootstrap, this is a good place to do it. | cakephp_cakephp | train | php |
d6f56615cd02a77416f2c01967c9c45529779d60 | diff --git a/controller/space_areas_blackbox_test.go b/controller/space_areas_blackbox_test.go
index <HASH>..<HASH> 100644
--- a/controller/space_areas_blackbox_test.go
+++ b/controller/space_areas_blackbox_test.go
@@ -151,9 +151,9 @@ func (rest *TestSpaceAreaREST) TestListAreasOKUsingExpiredIfNoneMatchHeader() {
func (rest *TestSpaceAreaREST) TestListAreasNotModifiedUsingIfModifiedSinceHeader() {
// given
- parentArea, _, _ := rest.setupAreas()
+ parentArea, _, areas := rest.setupAreas()
// when
- ifModifiedSince := app.ToHTTPTime(parentArea.UpdatedAt)
+ ifModifiedSince := app.ToHTTPTime(areas[len(areas)-1].UpdatedAt)
res := test.ListSpaceAreasNotModified(rest.T(), rest.svcSpaceAreas.Context, rest.svcSpaceAreas, rest.ctrlSpaceAreas, parentArea.SpaceID.String(), &ifModifiedSince, nil)
// then
assertResponseHeaders(rest.T(), res) | Bug in space areas test (#<I>) (#<I>)
Fixes #<I> | fabric8-services_fabric8-auth | train | go |
25e4f9962c6e10e1844e0785633b01de9447ef82 | diff --git a/quark/plugin.py b/quark/plugin.py
index <HASH>..<HASH> 100644
--- a/quark/plugin.py
+++ b/quark/plugin.py
@@ -803,6 +803,7 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
ip_version,
ip_address)
port["ip_addresses"].append(address)
+ context.session.add(address)
return self._make_ip_dict(address)
def update_ip_address(self, context, id, ip_address): | Added context.session.add at end of create_ip_address | openstack_quark | train | py |
875d5e5ddf1b51b63bb079c285e59c59361fbea5 | diff --git a/lib/rest-graph.rb b/lib/rest-graph.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-graph.rb
+++ b/lib/rest-graph.rb
@@ -273,19 +273,23 @@ class RestGraph < RestGraphStruct
def multi *requests
start_time = Time.now
- m = EM::MultiRequest.new
- requests.each{ |(method, path, query, opts)|
+ reqs = requests.map{ |(method, path, query, opts)|
query ||= {}; opts ||= {}
- m.add(EM::HttpRequest.new(graph_server + path).
- send(method, {:query => query}.merge(opts)))
+ EM::HttpRequest.new(graph_server + path).
+ send(method, {:query => query}.merge(opts)){ |c|
+ c.callback{
+ log_handler.call(
+ Event::Requested.new(Time.now - start_time, c.uri))
+ }
+ }
}
- m.callback{
+ EM::MultiRequest.new(reqs){ |m|
+ log_handler.call(Event::Requested.new(Time.now - start_time,
+ m.responses.values.flatten.map(&:uri).join(', ')))
+
yield(m.responses.values.flatten.map(&:response).
map(&method(:post_request)))
}
- ensure
- log_handler.call(Time.now - start_time,
- m.responses.values.flatten.map(&:uri).map(&:to_s))
end | rest-graph.rb: fix RestGraph#multi with latest em-http-request | godfat_rest-core | train | rb |
ce4a602e7dc5e1d08b1f19614ab461df3b2422a5 | diff --git a/cytomine/tests/test_image.py b/cytomine/tests/test_image.py
index <HASH>..<HASH> 100644
--- a/cytomine/tests/test_image.py
+++ b/cytomine/tests/test_image.py
@@ -32,18 +32,19 @@ class TestAbstractImage:
assert (isinstance(abstract_image, AbstractImage))
assert (abstract_image.filename == filename)
- abstract_image = AbstractImage().fetch(abstract_image.id)
- assert (isinstance(abstract_image, AbstractImage))
- assert (abstract_image.filename == filename)
-
- filename = random_string()
- abstract_image.filename = filename
- abstract_image.update()
- assert (isinstance(abstract_image, AbstractImage))
- assert (abstract_image.filename == filename)
-
- abstract_image.delete()
- assert (not AbstractImage().fetch(abstract_image.id))
+ # TODO: problem of access rights in core prevent the successful execution of following tests
+ # abstract_image = AbstractImage().fetch(abstract_image.id)
+ # assert (isinstance(abstract_image, AbstractImage))
+ # assert (abstract_image.filename == filename)
+ #
+ # filename = random_string()
+ # abstract_image.filename = filename
+ # abstract_image.update()
+ # assert (isinstance(abstract_image, AbstractImage))
+ # assert (abstract_image.filename == filename)
+ #
+ # abstract_image.delete()
+ # assert (not AbstractImage().fetch(abstract_image.id))
def test_abstract_image_server(self, connect, dataset):
# TODO | Skip tests related to abstract image, failing due to issue in core | cytomine_Cytomine-python-client | train | py |
9033474513b9a518bfac0391d0140c122174d4b0 | diff --git a/src/main/java/org/jboss/aesh/console/Console.java b/src/main/java/org/jboss/aesh/console/Console.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/aesh/console/Console.java
+++ b/src/main/java/org/jboss/aesh/console/Console.java
@@ -433,7 +433,6 @@ public class Console {
if(settings.isLogging())
LOGGER.info("Done stopping services. Terminal is reset");
- settings.getInputStream().close();
settings.getStdErr().close();
settings.getStdOut().close();
if(settings.isLogging())
diff --git a/src/main/java/org/jboss/aesh/terminal/POSIXTerminal.java b/src/main/java/org/jboss/aesh/terminal/POSIXTerminal.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/aesh/terminal/POSIXTerminal.java
+++ b/src/main/java/org/jboss/aesh/terminal/POSIXTerminal.java
@@ -198,7 +198,6 @@ public class POSIXTerminal extends AbstractTerminal {
@Override
public void close() throws IOException {
- settings.getInputStream().close();
input.stop();
} | closing inputstream seems to block on osx | aeshell_aesh | train | java,java |
432075b4347d0654982a82d7f8addef568bdbdc4 | diff --git a/code/javascript/selenium-fitrunner.js b/code/javascript/selenium-fitrunner.js
index <HASH>..<HASH> 100644
--- a/code/javascript/selenium-fitrunner.js
+++ b/code/javascript/selenium-fitrunner.js
@@ -376,6 +376,7 @@ function postTestResults(suiteFailed, suiteTable) {
form.id = "resultsForm";
form.method="post";
+ form.target="myiframe";
var resultsUrl = getQueryParameter("resultsUrl");
if (!resultsUrl) { | Made postResults target the AUT iframe when displaying its results.
r<I> | SeleniumHQ_selenium | train | js |
5456eb8304abf999d0e5d98283eebf36c77444ab | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -39,19 +39,6 @@ try {
'Please add gulp ^' + packageGulpVersion + ' to your package.json, npm install and try again.'
);
}
-try {
- // Check to make sure the local gulp and the project gulp match.
- var packageGulpVersion = require('./node_modules/gulp/package.json').version;
- if (semver.satisfies(projectGulpVersion, '^' + packageGulpVersion)) {
- fatal(
- 'You do not have the correct version of Gulp installed in your project.',
- 'Please add gulp ^' + packageGulpVersion + ' to your package.json, npm install and try again.'
- );
- }
-} catch(e) {
- // Assume gulp has been loaded from ../node_modules and it matches the requirements.
-}
-
/**
* This package exports a function that binds tasks to a gulp instance | ignore global gulp
@JedWatson, this never worked anyway because semver is undefined.
Tis' what you get for `catch (e) {}` | touchstonejs_touchstonejs-tasks | train | js |
73c8836aaff5e3aa62c4e6fb48617644313d09dc | diff --git a/storm.go b/storm.go
index <HASH>..<HASH> 100644
--- a/storm.go
+++ b/storm.go
@@ -272,7 +272,7 @@ func (s *DB) checkVersion() error {
}
// for now, we only set the current version if it doesn't exist or if v0.5.0
- if v == "" || v == "0.5.0" {
+ if v == "" || v == "0.5.0" || v == "0.6.0" {
return s.Set(dbinfo, "version", Version)
}
diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -1,4 +1,4 @@
package storm
// Version of Storm
-const Version = "0.6.0"
+const Version = "0.6.1" | Bump to version <I> | asdine_storm | train | go,go |
c5149b77e793bd1d259de07e8563bdc3033f1cc6 | diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php
+++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php
@@ -180,10 +180,9 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
$class->setDatabase($parent->getDatabase());
$class->setCollection($parent->getCollection());
- if (! $class->writeConcern) {
+ if ($class->writeConcern === null) {
$class->setWriteConcern($parent->writeConcern);
}
-
}
$class->setParentClasses($nonSuperclassParents); | Typesafe check for existing writeConcern | doctrine_mongodb-odm | train | php |
f3b4aff8365d558f5ce2e8a0b7c185ceb662a850 | diff --git a/src/Configuration/PathResolver.php b/src/Configuration/PathResolver.php
index <HASH>..<HASH> 100644
--- a/src/Configuration/PathResolver.php
+++ b/src/Configuration/PathResolver.php
@@ -27,13 +27,14 @@ class PathResolver
public static function defaultPaths()
{
return [
- 'app' => 'app',
+ 'site' => '.',
+ 'app' => '%site%/app',
'cache' => '%app%/cache',
'config' => '%app%/config',
'database' => '%app%/database',
- 'extensions' => 'extensions',
+ 'extensions' => '%site%/extensions',
'extensions_config' => '%config%/extensions',
- 'web' => 'public',
+ 'web' => '%site%/public',
'files' => '%web%/files',
'themes' => '%web%/theme',
'bolt_assets' => '%web%/bolt-public/view', | Added "site" path alias, which acts as the root directory for all site files (app, web, extensions).
By default it is the same as root, but this allows for all paths to be moved to a subdir at once.
"root" cannot be used for this as it needs to be the root directory
containing the "vendor" dir, so that paths can be made relative correctly. | bolt_bolt | train | php |
f481df44e3bad41c608bb3223c525a0976fe6e87 | diff --git a/lib/atomy/compiler.rb b/lib/atomy/compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/atomy/compiler.rb
+++ b/lib/atomy/compiler.rb
@@ -12,7 +12,13 @@ module Atomy
end
def package(file, line = 0, state = LocalState.new, &blk)
- generate(file, line, state, &blk).package(Rubinius::CompiledCode)
+ generate(file, line, state, &blk).package(Rubinius::CompiledCode).tap do |code|
+ if ENV["DEBUG"]
+ printer = CodeTools::Compiler::MethodPrinter.new
+ printer.bytecode = true
+ printer.print_method(code)
+ end
+ end
end
def generate(file, line = 0, state = LocalState.new) | print bytecode/etc with $DEBUG set | vito_atomy | train | rb |
ad64f76d344d1044af82662b4a4f02606098669c | diff --git a/src/Guzzle/Http/AbstractEntityBodyDecorator.php b/src/Guzzle/Http/AbstractEntityBodyDecorator.php
index <HASH>..<HASH> 100644
--- a/src/Guzzle/Http/AbstractEntityBodyDecorator.php
+++ b/src/Guzzle/Http/AbstractEntityBodyDecorator.php
@@ -303,14 +303,4 @@ class AbstractEntityBodyDecorator implements EntityBodyInterface
return $this;
}
-
- /**
- * Get the wrapped EntityBody object
- *
- * @return EntityBodyInterface
- */
- public function getDecoratedBody()
- {
- return $this->body;
- }
} | Removing the getDecoratedBody() method from AbstractEntityBodyDecorator. That was a mistake | guzzle_guzzle3 | train | php |
f8bf7fadebdd8f76ace46d002a206e3cad719a85 | diff --git a/lib/attr_keyring/active_record.rb b/lib/attr_keyring/active_record.rb
index <HASH>..<HASH> 100644
--- a/lib/attr_keyring/active_record.rb
+++ b/lib/attr_keyring/active_record.rb
@@ -17,11 +17,13 @@ module AttrKeyring
target.prepend(
Module.new do
def reload(options = nil)
- super
+ instance = super
self.class.encrypted_attributes.each do |attribute|
clear_decrypted_column_cache(attribute)
end
+
+ instance
end
end
)
diff --git a/test/active_record_test.rb b/test/active_record_test.rb
index <HASH>..<HASH> 100644
--- a/test/active_record_test.rb
+++ b/test/active_record_test.rb
@@ -15,6 +15,16 @@ class ActiveRecordTest < Minitest::Test # rubocop:disable Metrics/ClassLength
end
end
+ test "reloads keeps working" do
+ model_class = create_model do
+ attr_keyring "0" => "uDiMcWVNTuz//naQ88sOcN+E40CyBRGzGTT7OkoBS6M="
+ attr_encrypt :secret
+ end
+
+ user = model_class.create(secret: "42")
+ assert_equal user, user.reload
+ end
+
test "encrypts value" do
model_class = create_model do
attr_keyring "0" => "uDiMcWVNTuz//naQ88sOcN+E40CyBRGzGTT7OkoBS6M=" | Ensure ActiveRecord::Base#reload keeps working. | fnando_attr_keyring | train | rb,rb |
83b66b473ea7a63de791c7ba8821c14c69fdf1c8 | diff --git a/includes/os/class.WINNT.inc.php b/includes/os/class.WINNT.inc.php
index <HASH>..<HASH> 100644
--- a/includes/os/class.WINNT.inc.php
+++ b/includes/os/class.WINNT.inc.php
@@ -542,6 +542,18 @@ class WINNT extends OS
return $this->_syslang;
}
+ public function _processes()
+ {
+ $processes['*'] = 0;
+ $buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_Process', array('Caption'));
+
+ foreach ($buffer as $process) {
+ $processes['*']++;
+ }
+ $this->sys->setProcesses($processes);
+ }
+
+
/**
* get the information
*
@@ -566,5 +578,6 @@ class WINNT extends OS
$this->_filesystems();
$this->_memory();
$this->_loadavg();
+ $this->_processes();
}
} | experimental: number of process for Windows (test with Windows 8) | phpsysinfo_phpsysinfo | train | php |
0782b5dad67dc988f1c32e4d3dd37eae4e4407c8 | diff --git a/serf/snapshot.go b/serf/snapshot.go
index <HASH>..<HASH> 100644
--- a/serf/snapshot.go
+++ b/serf/snapshot.go
@@ -84,7 +84,7 @@ func NewSnapshotter(path string,
inCh := make(chan Event, 1024)
// Try to open the file
- fh, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0755)
+ fh, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
return nil, nil, fmt.Errorf("failed to open snapshot: %v", err)
} | remove the execute flag from the created snapshot files | hashicorp_serf | train | go |
720df757399c82af2b62f15dfef6fd564af59b9f | diff --git a/tests/fake_model.py b/tests/fake_model.py
index <HASH>..<HASH> 100644
--- a/tests/fake_model.py
+++ b/tests/fake_model.py
@@ -4,8 +4,6 @@ from django.db import models, connection, migrations
from django.db.migrations.executor import MigrationExecutor
from django.contrib.postgres.operations import HStoreExtension
-from django.apps import apps
-
def define_fake_model(fields=None):
name = str(uuid.uuid4()).replace('-', '')[:8] | Remove unused imports from fake_model.py | SectorLabs_django-postgres-extra | train | py |
8d9d2949a18cd3d5be526c01c3bc3c5b3cafe8e2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
"""Package information for capidup."""
-from distutils.core import setup
+from setuptools import setup
setup(
name='capidup',
@@ -10,7 +10,7 @@ setup(
author_email='[email protected]',
version='1.0dev',
packages=['capidup',],
- entry_points = {
+ entry_points={
'console_scripts': [ 'capidup=capidup.cli:main' ],
},
license='License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', | Use setuptools for packaging instead of distutils.
distutils doesn't explicitly support entry_points. Also, setuptools is
recommended as more future-proof in the "official" PyPI guide:
<URL> | israel-lugo_capidup | train | py |
702931877b8a1cc41ccd89530d128d30785e8f04 | diff --git a/src/View.js b/src/View.js
index <HASH>..<HASH> 100644
--- a/src/View.js
+++ b/src/View.js
@@ -17,7 +17,7 @@ var Cursor = require('./Cursor');
var CollectionBinder = require('./CollectionBinder');
var BinderMap = require('./BinderMap');
-var bindingRegex = /(?:([_.a-zA-Z0-9*-]+))(?:\(([@.a-zA-Z0-9*,\s-]+)*\))?((?::[a-zA-Z0-9]+(?:\((?:[^()]*)\))?)*)/g;
+var bindingRegex = /(?:([_\.a-zA-Z0-9*-]+))(?:\(([@\/.a-zA-Z0-9*,\s-]+)*\))?((?::[a-zA-Z0-9]+(?:\((?:[^()]*)\))?)*)/g;
var operatorsRegex = /:([a-zA-Z0-9]+)(?:\(([^()]*)\))?/g; | fix(View): allow / character in bindings computed function params | karfcz_kff | train | js |
bea1bf3519ccf226bf1afe0fb8afcd1445ea7d9c | diff --git a/DrdPlus/Codes/PropertyCodes.php b/DrdPlus/Codes/PropertyCodes.php
index <HASH>..<HASH> 100644
--- a/DrdPlus/Codes/PropertyCodes.php
+++ b/DrdPlus/Codes/PropertyCodes.php
@@ -42,7 +42,7 @@ class PropertyCodes
const SENSES = 'senses';
const SPEED = 'speed';
const TOUGHNESS = 'toughness';
- const WOUNDS_LIMIT = 'wounds_limit';
+ const WOUND_BOUNDARY = 'wound_boundary';
// native
const INFRAVISION = 'infravision'; | Wounds limit renamed to wound boundary to clarify its meaning | drdplusinfo_drdplus-codes | train | php |
f7d7c07a4dfcff64939e65511f0ecf7155df96b1 | diff --git a/src/Decoder/DecoderResult.php b/src/Decoder/DecoderResult.php
index <HASH>..<HASH> 100644
--- a/src/Decoder/DecoderResult.php
+++ b/src/Decoder/DecoderResult.php
@@ -30,13 +30,13 @@ use function property_exists;
*/
final class DecoderResult{
- protected array $rawBytes;
- protected string $data;
- protected Version $version;
- protected EccLevel $eccLevel;
- protected MaskPattern $maskPattern;
- protected int $structuredAppendParity = -1;
- protected int $structuredAppendSequence = -1;
+ private array $rawBytes;
+ private string $data;
+ private Version $version;
+ private EccLevel $eccLevel;
+ private MaskPattern $maskPattern;
+ private int $structuredAppendParity = -1;
+ private int $structuredAppendSequence = -1;
/**
* DecoderResult constructor. | :octocat: protected -> private | chillerlan_php-qrcode | train | php |
50dea1b7915b4fb17d255ec60b41f7c09fbb5c44 | diff --git a/repository/lib.php b/repository/lib.php
index <HASH>..<HASH> 100644
--- a/repository/lib.php
+++ b/repository/lib.php
@@ -800,9 +800,7 @@ abstract class repository {
* @global object $USER
* @global object $OUTPUT
* @param string $thefile file path in download folder
- * @param string $name file name
- * @param integer $itemid item id to identify a file in filepool
- * @param string $filearea file area
+ * @param object $record
* @return array containing the following keys:
* icon
* file | fixed incorect docs that were breaking install of mnet stuff | moodle_moodle | train | php |
45eef9c16868f06ffafc21aaf72a76748ffe6cc2 | diff --git a/source/net/malisis/core/client/gui/component/decoration/UIImage.java b/source/net/malisis/core/client/gui/component/decoration/UIImage.java
index <HASH>..<HASH> 100644
--- a/source/net/malisis/core/client/gui/component/decoration/UIImage.java
+++ b/source/net/malisis/core/client/gui/component/decoration/UIImage.java
@@ -35,10 +35,10 @@ import net.minecraft.util.ResourceLocation;
/**
* UIImage
- *
+ *
* @author PaleoCrafter
*/
-public class UIImage extends UIComponent
+public class UIImage extends UIComponent<UIImage>
{
public static final ResourceLocation BLOCKS_TEXTURE = TextureMap.locationBlocksTexture;
public static final ResourceLocation ITEMS_TEXTURE = TextureMap.locationItemsTexture;
@@ -96,6 +96,16 @@ public class UIImage extends UIComponent
return this;
}
+ public IIcon getIcon()
+ {
+ return icon;
+ }
+
+ public ItemStack getItemStack()
+ {
+ return itemStack;
+ }
+
@Override
public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
{} | Added getter for IIcon and ItemStack | Ordinastie_MalisisCore | train | java |
770cadcd091050a058c20a6295bf251166588d7a | diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py
index <HASH>..<HASH> 100644
--- a/netmiko/base_connection.py
+++ b/netmiko/base_connection.py
@@ -287,7 +287,7 @@ class BaseSSHConnection(object):
print("bbb: {}".format(prompt))
# Check if the only thing you received was a newline
count = 0
- while count <= 10 and not prompt:
+ while count <= 50 and not prompt:
if self.wait_for_recv_ready():
prompt = self.remote_conn.recv(MAX_BUFFER).decode('utf-8', 'ignore')
if debug:
@@ -296,6 +296,8 @@ class BaseSSHConnection(object):
if self.ansi_escape_codes:
prompt = self.strip_ansi_escape_codes(prompt)
prompt = prompt.strip()
+ else:
+ time.sleep(delay_factor)
count += 1
if debug: | Fixing timing issue on find_prompt | ktbyers_netmiko | train | py |
c447a24d49ace124c69165fc5a0979d60832db4b | diff --git a/config/environment.js b/config/environment.js
index <HASH>..<HASH> 100644
--- a/config/environment.js
+++ b/config/environment.js
@@ -1,7 +1,5 @@
'use strict';
-module.exports = function(environment, appConfig) {
- // Override the default disabled state for testing this addon
- appConfig.rollbar = { enabled: true };
+module.exports = function(/* environment, appConfig */) {
return {};
};
diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/config/environment.js
+++ b/tests/dummy/config/environment.js
@@ -16,6 +16,9 @@ module.exports = function(environment) {
APP: {
// Here you can pass flags/options to your application instance
// when it is created
+ },
+ rollbar: {
+ enabled: true
}
}; | fix enabled flag to be always true during tests of this addon rather than for consuming apps | davewasmer_ember-cli-rollbar | train | js,js |
708b3df0a2dac0b0b50f6aa468ef3bb55e1c6af8 | diff --git a/tasks/easy_rpm.js b/tasks/easy_rpm.js
index <HASH>..<HASH> 100644
--- a/tasks/easy_rpm.js
+++ b/tasks/easy_rpm.js
@@ -8,8 +8,18 @@
'use strict';
-var shortid = require("shortid"),
- path = require("path");
+var fs = require("fs"),
+ path = require("path"),
+ shortid = require("shortid");
+
+function preserveCopy(srcpath, destpath, options) {
+ grunt.file.copy(srcpath, destpath, options);
+ try {
+ fs.chmodSync(destpath, fs.statSync(srcpath).mode);
+ } catch (e) {
+ throw grunt.util.error('Error setting permissions of "' + destpath + '" file.', e);
+ }
+}
function writeSpecFile(grunt, files, options) {
@@ -170,7 +180,7 @@ module.exports = function(grunt) {
//for generating the SPEC file
if (!grunt.file.isDir(actualSrcPath)) {
grunt.verbose.writeln("Copying: " + actualSrcPath);
- grunt.file.copy(actualSrcPath, copyTargetPath);
+ preserveCopy(actualSrcPath, copyTargetPath);
//Generate actualTargetPath and save to filebasket for later use
var actualTargetPath = path.join(file.dest, srcPath); | Preserve file permissions on copy. | panitw_easy-rpm | train | js |
4e18a2d6ef15d66cd994339457ebd29601c0c322 | diff --git a/lib/util/http-mgr.js b/lib/util/http-mgr.js
index <HASH>..<HASH> 100644
--- a/lib/util/http-mgr.js
+++ b/lib/util/http-mgr.js
@@ -154,6 +154,7 @@ function readFile(url, callback) {
}
done = true;
data.mtime = time;
+ stream.close();
triggerChange(data, body);
};
stream.on('data', function(text) { | feat: support to load rules from local file by @localFilePath | avwo_whistle | train | js |
db301eea54039dc6013956f338d836f3c30488f2 | diff --git a/src/umbra/components/factory/scriptEditor/scriptEditor.py b/src/umbra/components/factory/scriptEditor/scriptEditor.py
index <HASH>..<HASH> 100644
--- a/src/umbra/components/factory/scriptEditor/scriptEditor.py
+++ b/src/umbra/components/factory/scriptEditor/scriptEditor.py
@@ -2939,7 +2939,7 @@ class ScriptEditor(QWidgetComponentFactory(uiFile=COMPONENT_UI_FILE)):
continue
paths = [node.path for node in parentNode.children]
- for directory in directories:
+ for directory in sorted(directories):
if directory.startswith("."):
continue
@@ -2949,7 +2949,7 @@ class ScriptEditor(QWidgetComponentFactory(uiFile=COMPONENT_UI_FILE)):
directoryNode = self.__model.registerDirectory(path, parentNode)
- for file in files:
+ for file in sorted(files):
if file.startswith("."):
continue | Ensure projects nodes are sorted in "scriptEditor" component. | KelSolaar_Umbra | train | py |
34a2a2eaea25919a48b9810b45a6971cbffa79f9 | diff --git a/src/Serializer/YamlSerializer.php b/src/Serializer/YamlSerializer.php
index <HASH>..<HASH> 100644
--- a/src/Serializer/YamlSerializer.php
+++ b/src/Serializer/YamlSerializer.php
@@ -36,6 +36,6 @@ class YamlSerializer implements ParameterSerializerInterface
$output .= \NordCode\RoboParameters\wrap_lines($fileHeader, '# ') . "\n";
}
- return $output . $this->yamlDumper->dump($parameters);
+ return $output . $this->yamlDumper->dump($parameters, 4);
}
} | Don't use inline syntax in YAML for the first 4 levels | nordcode_robo-parameters | train | php |
74fee3c9c66053bd0f2084c8e5feb158eb1a1540 | diff --git a/src/Modal/ModalContents.js b/src/Modal/ModalContents.js
index <HASH>..<HASH> 100644
--- a/src/Modal/ModalContents.js
+++ b/src/Modal/ModalContents.js
@@ -1,3 +1,4 @@
+import classNames from 'classnames/dedupe';
import GeminiScrollbar from 'react-gemini-scrollbar';
/* eslint-disable no-unused-vars */
import React, {PropTypes} from 'react';
@@ -238,7 +239,7 @@ class ModalContents extends Util.mixin(BindMixin, KeyDownMixin) {
if (props.open) {
modalContent = (
- <div className={props.modalWrapperClass}>
+ <div className={classNames('modal-wrapper', props.modalWrapperClass)}>
{this.getBackdrop()}
{this.getModal()}
</div>
@@ -286,7 +287,6 @@ ModalContents.defaultProps = {
footerClass: 'modal-footer',
headerClass: 'modal-header',
modalClass: 'modal modal-large',
- modalWrapperClass: 'modal-wrapper',
scrollContainerClass: 'modal-body'
}; | Using `classNames` to make sure we are able to add to class | mesosphere_reactjs-components | train | js |
82d26475156ba67e96cb1d9d479fa1618480889f | diff --git a/lib/trax/model/json_attribute.rb b/lib/trax/model/json_attribute.rb
index <HASH>..<HASH> 100644
--- a/lib/trax/model/json_attribute.rb
+++ b/lib/trax/model/json_attribute.rb
@@ -4,26 +4,11 @@ module Trax
module Model
class JsonAttribute < ::Hashie::Dash
include Hashie::Extensions::IgnoreUndeclared
+ include ActiveModel::Validations
- def initialize(*args, **named_args)
- super(*args)
+ def inspect
+ self.to_hash.inspect
end
-
- def self.property(name, *args)
- super(name, *args)
-
- # define_method("#{name}=") do |val|
- # assert_property_required! name, val
- # assert_property_exists! name
- #
- # @owner.__send__(@attribute_name)[name] = val
- # @owner[@attribute_name] = self.to_hash
- # end
- end
-
- private
-
- attr_accessor :owner, :attribute_name
end
end
end | json attributes now definable inline in model, with specific schema, validations independent of model. BOOYA | jasonayre_trax_model | train | rb |
131c7ff3e9332a772211317f1c2519ca6afd6378 | diff --git a/ca/django_ca/management/commands/import_ca.py b/ca/django_ca/management/commands/import_ca.py
index <HASH>..<HASH> 100644
--- a/ca/django_ca/management/commands/import_ca.py
+++ b/ca/django_ca/management/commands/import_ca.py
@@ -75,7 +75,7 @@ Note that the private key will be copied to the directory configured by the CA_D
except:
try:
pem_loaded = x509.load_der_x509_certificate(pem_data, default_backend())
- except Exception as e:
+ except:
raise CommandError('Unable to load public pem.')
ca.x509 = pem_loaded
ca.private_key_path = os.path.join(ca_settings.CA_DIR, '%s.key' % ca.serial)
@@ -86,7 +86,7 @@ Note that the private key will be copied to the directory configured by the CA_D
except:
try:
key_loaded = serialization.load_der_private_key(key_data, import_password, default_backend())
- except Exception as e:
+ except:
raise CommandError('Unable to load public pem.')
if password is None: | we don't care about the exception | mathiasertl_django-ca | train | py |
a94d6fd325ecaf78193f6ec7c9cfc626995e6496 | diff --git a/lib/fast.rb b/lib/fast.rb
index <HASH>..<HASH> 100644
--- a/lib/fast.rb
+++ b/lib/fast.rb
@@ -51,16 +51,12 @@ module Fast
end
def parse
- if (token = next_token) == '('
- parse_untill_peek(')')
- elsif token == '{'
- Any.new(parse_untill_peek('}'))
- elsif token == '$'
- Capture.new(parse)
- elsif token == '!'
- Not.new(parse)
- else
- Find.new(token)
+ case (token = next_token)
+ when '(' then parse_untill_peek(')')
+ when '{' then Any.new(parse_untill_peek('}'))
+ when '$' then Capture.new(parse)
+ when '!' then Not.new(parse)
+ else Find.new(token)
end
end | Switch `if` to `case` :zipper_mouth_face: | jonatas_fast | train | rb |
8b71878a6161d514c28935e30258d74fd31159ad | diff --git a/lib/beetle/publisher.rb b/lib/beetle/publisher.rb
index <HASH>..<HASH> 100644
--- a/lib/beetle/publisher.rb
+++ b/lib/beetle/publisher.rb
@@ -210,7 +210,7 @@ module Beetle
end
end
rescue Exception => e
- logger.error "Beetle: error closing down bunny #{e}"
+ logger.warn "Beetle: error closing down bunny #{e}"
Beetle::reraise_expectation_errors!
ensure
@bunnies[@server] = nil | log exceptions on closing down bunny as warnings | xing_beetle | train | rb |
cced16a9f468a37dcb396a5adfc56d06d0e8c31e | diff --git a/salt/modules/file.py b/salt/modules/file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -3555,10 +3555,10 @@ def manage_file(name,
sfn = __salt__['cp.cache_file'](source, saltenv)
if not sfn:
return _error(
- ret, 'Source file {0} not found'.format(source))
- # If the downloaded file came from a non salt server source verify
- # that it matches the intended sum value
- if _urlparse(source).scheme != 'salt':
+ ret, 'Source file {0!r} not found'.format(source))
+ # If the downloaded file came from a non salt server or local source
+ # verify that it matches the intended sum value
+ if _urlparse(source).scheme not in ('salt','') :
dl_sum = get_hash(sfn, source_sum['hash_type'])
if dl_sum != source_sum['hsum']:
ret['comment'] = ('File sum set for file {0} of {1} does ' | Support local files without md5sum
see issue #<I> | saltstack_salt | train | py |
404ee9a0de4390af5b2c8078197b6c33084c5fd6 | diff --git a/test/ResponseStackTest.php b/test/ResponseStackTest.php
index <HASH>..<HASH> 100644
--- a/test/ResponseStackTest.php
+++ b/test/ResponseStackTest.php
@@ -1,12 +1,11 @@
<?php
-use donatj\MockWebServer\RequestInfo;
use donatj\MockWebServer\ResponseStack;
class ResponseStackTest extends \PHPUnit_Framework_TestCase {
public function testEmpty() {
- $mock = $this->getMockBuilder(RequestInfo::class)->disableOriginalConstructor()->getMock();
+ $mock = $this->getMockBuilder('\donatj\MockWebServer\RequestInfo')->disableOriginalConstructor()->getMock();
$x = new ResponseStack();
@@ -20,7 +19,7 @@ class ResponseStackTest extends \PHPUnit_Framework_TestCase {
* @dataProvider customResponseProvider
*/
public function testCustomPastEndResponse( $body, $headers, $status ) {
- $mock = $this->getMockBuilder(RequestInfo::class)->disableOriginalConstructor()->getMock();
+ $mock = $this->getMockBuilder('\donatj\MockWebServer\RequestInfo')->disableOriginalConstructor()->getMock();
$x = new ResponseStack();
$x->setPastEndResponse(new \donatj\MockWebServer\Response($body, $headers, $status)); | Update test to support PHP <I> | donatj_mock-webserver | train | php |
99b6a788ba898303da74d46dd47a99761ea47b0b | diff --git a/hearthstone/enums.py b/hearthstone/enums.py
index <HASH>..<HASH> 100644
--- a/hearthstone/enums.py
+++ b/hearthstone/enums.py
@@ -532,6 +532,29 @@ class Rarity(IntEnum):
Rarity.LEGENDARY,
)
+ @property
+ def crafting_costs(self):
+ return CRAFTING_COSTS.get(self, (0, 0))
+
+ @property
+ def disenchant_costs(self):
+ return DISENCHANT_COSTS.get(self, (0, 0))
+
+
+CRAFTING_COSTS = {
+ Rarity.COMMON: (40, 400),
+ Rarity.RARE: (100, 800),
+ Rarity.EPIC: (400, 1600),
+ Rarity.LEGENDARY: (1600, 3200),
+}
+
+DISENCHANT_COSTS = {
+ Rarity.COMMON: (5, 50),
+ Rarity.RARE: (20, 100),
+ Rarity.EPIC: (100, 400),
+ Rarity.LEGENDARY: (400, 1600),
+}
+
class Zone(IntEnum):
INVALID = 0 | enums: Add crafting/disenchant costs to Rarity | HearthSim_python-hearthstone | train | py |
d21350ff1d2d09afdff95b8244ae9bb47b26c5ea | diff --git a/Lib/extractor/stream.py b/Lib/extractor/stream.py
index <HASH>..<HASH> 100644
--- a/Lib/extractor/stream.py
+++ b/Lib/extractor/stream.py
@@ -80,7 +80,6 @@ class InstructionStream(object):
else:
# Take number of arguments from the stream
_, num_args = self.read_byte()
- args.append(str(num_args))
if cmd_name.endswith("B"):
for n in range(num_args):
_, i = self.read_byte() | Fix output of NPUSHB, NPUSHW | robotools_extractor | train | py |
af861a8e61dbbb278040c37895fc898e7fe04245 | diff --git a/pkg/model/components/containerd.go b/pkg/model/components/containerd.go
index <HASH>..<HASH> 100644
--- a/pkg/model/components/containerd.go
+++ b/pkg/model/components/containerd.go
@@ -47,7 +47,7 @@ func (b *ContainerdOptionsBuilder) BuildOptions(o interface{}) error {
// Set version based on Kubernetes version
if fi.StringValue(containerd.Version) == "" {
if b.IsKubernetesGTE("1.19") {
- containerd.Version = fi.String("1.4.10")
+ containerd.Version = fi.String("1.4.11")
} else {
containerd.Version = fi.String("1.3.10")
} | Update containerd to <I> | kubernetes_kops | train | go |
76bae6b042194d4f78865f09af6a018609cd39dc | diff --git a/code/libraries/koowa/components/com_activities/views/activities/json.php b/code/libraries/koowa/components/com_activities/views/activities/json.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_activities/views/activities/json.php
+++ b/code/libraries/koowa/components/com_activities/views/activities/json.php
@@ -190,10 +190,6 @@ class ComActivitiesViewActivitiesJson extends KViewJson
$data['value'] = $this->getObject('translator')->translate($object->getValue());
}
- if (!$object->isParameter()) {
- unset($data['parameter']);
- }
-
// Remove translatable status.
unset($data['translate']); | re #<I> Cleanup. | joomlatools_joomlatools-framework | train | php |
8a7168b7a5d5e048aa1e22ea6b311278fe6bccfc | diff --git a/src/Providers/ArboryAuthServiceProvider.php b/src/Providers/ArboryAuthServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Providers/ArboryAuthServiceProvider.php
+++ b/src/Providers/ArboryAuthServiceProvider.php
@@ -49,7 +49,6 @@ class ArboryAuthServiceProvider extends ServiceProvider
$this->registerCheckpoints();
$this->registerReminders();
$this->registerSentinel();
- $this->setUserResolver();
}
/**
@@ -396,20 +395,4 @@ class ArboryAuthServiceProvider extends ServiceProvider
{
return mt_rand( 1, $lottery[1] ) <= $lottery[0];
}
-
- /**
- * Sets the user resolver on the request class.
- *
- * @return void
- */
- protected function setUserResolver()
- {
- $this->app->rebinding( 'request', function ( $app, $request )
- {
- $request->setUserResolver( function () use ( $app )
- {
- return $app['sentinel']->getUser();
- } );
- } );
- }
} | Remove request user binding due to conflict with public website authorization | arbory_arbory | train | php |
51cda195ff620a5594ad063cf8c9faffd5068415 | diff --git a/src/Commando/Command.php b/src/Commando/Command.php
index <HASH>..<HASH> 100644
--- a/src/Commando/Command.php
+++ b/src/Commando/Command.php
@@ -321,7 +321,7 @@ class Command implements \ArrayAccess
{
$matches = array();
- if (!preg_match('/(?P<hyphen>\-{1,2})?(?P<name>[a-z][a-z0-9_]*)/i', $token, $matches)) {
+ if (substr($token, 0, 1) === '-' && !preg_match('/(?P<hyphen>\-{1,2})(?P<name>[a-z][a-z0-9_]*)/i', $token, $matches)) {
throw new \Exception(sprintf('Unable to parse option %s: Invalid syntax', $token));
}
@@ -502,4 +502,4 @@ class Command implements \ArrayAccess
$this->options[$offset]->setValue(null);
}
-}
\ No newline at end of file
+} | fixes #2 reopened
only perform validation on options/flags not arguments/values | nategood_commando | train | php |
c1221a05babd112936d936826da6ad403f45db0d | diff --git a/tensorboard/plugins/profile/profile_demo_data.py b/tensorboard/plugins/profile/profile_demo_data.py
index <HASH>..<HASH> 100644
--- a/tensorboard/plugins/profile/profile_demo_data.py
+++ b/tensorboard/plugins/profile/profile_demo_data.py
@@ -46,15 +46,15 @@ trace_events {
device_id: 1
resource_id: 2
name: "E1.2.1"
- timestamp_ns: 100
- duration_ns: 10
+ timestamp_ps: 100
+ duration_ps: 10
}
trace_events {
device_id: 2
resource_id: 2
name: "E2.2.1"
- timestamp_ns: 90
- duration_ns: 40
+ timestamp_ps: 90
+ duration_ps: 40
}
"""
@@ -81,13 +81,13 @@ trace_events {
device_id: 1
resource_id: 2
name: "E1.2.1"
- timestamp_ns: 10
- duration_ns: 1000
+ timestamp_ps: 10
+ duration_ps: 1000
}
trace_events {
device_id: 2
resource_id: 2
name: "E2.2.1"
- timestamp_ns: 105
+ timestamp_ps: 105
}
""" | [profile] Fix the broken demo (#<I>) | tensorflow_tensorboard | train | py |
47c2437a7264f10596b754e39edad19a304fd521 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ setup(
zip_safe=True,
install_requires=[
'tornado>=3.0.0,<4.1.0',
- 'six==1.7.3',
+ 'six>=1.7.3',
],
tests_require=[
'unittest2', | Don't fix dependency on specific version of six | globocom_tornado-es | train | py |
4ab92551b547c9659cacacce05574bb3a750ce57 | diff --git a/tests/test_tilegrids.py b/tests/test_tilegrids.py
index <HASH>..<HASH> 100644
--- a/tests/test_tilegrids.py
+++ b/tests/test_tilegrids.py
@@ -429,6 +429,10 @@ class TestGeoadminTileGrid(unittest.TestCase):
self.assertTrue(grid.intersectsExtent(withinCh))
self.assertFalse(grid.intersectsExtent(outsideCh))
+ outsideWorld = [-900, -300, 900, 300]
+ with self.assertRaises(AssertionError):
+ grid.tileAddress(5, [outsideWorld[0], outsideWorld[1]])
+
def testMercatorGridSwissBounds(self):
grid = GlobalMercatorTileGrid(useSwissExtent=True)
outsideCh = [502215, 5084416, 512215, 5184416]
@@ -442,6 +446,10 @@ class TestGeoadminTileGrid(unittest.TestCase):
self.assertTrue(grid.intersectsExtent(withinCh))
self.assertFalse(grid.intersectsExtent(outsideCh))
+ outsideWorld = [-90000000000, -30000000000, 90000000000, 30000000000]
+ with self.assertRaises(AssertionError):
+ grid.tileAddress(5, [outsideWorld[0], outsideWorld[1]])
+
def testMercatorGridBoundsAndAddress(self):
grid = GlobalMercatorTileGrid(useSwissExtent=False)
[z, x, y] = [8, 135, 91] | Assertion error when out of the global extent | geoadmin_lib-gatilegrid | train | py |
ade000cee41a2779e8e2aceee62e13c3c501cd4b | diff --git a/packages/generator-bolt/generators/component/templates/component.js b/packages/generator-bolt/generators/component/templates/component.js
index <HASH>..<HASH> 100644
--- a/packages/generator-bolt/generators/component/templates/component.js
+++ b/packages/generator-bolt/generators/component/templates/component.js
@@ -1,8 +1,8 @@
import { props, define, hasNativeShadowDomSupport } from '@bolt/core/utils';
-import { withLitHtml } from '@bolt/core/renderers/renderer-lit-html';
+import { withLitHtml, html } from '@bolt/core/renderers/renderer-lit-html';
import classNames from 'classnames/bind';
import styles from './<%= props.name.kebabCase %>.scss';
-import schema from '../<%= props.name.kebabCase %>.schema.yml';
+//import schema from '../<%= props.name.kebabCase %>.schema.yml'; //Todo: Uncomment when you will need schema
let cx = classNames.bind(styles);
@@ -25,7 +25,6 @@ class Bolt<%= props.name.pascalCase %> extends withLitHtml() {
constructor(self) {
self = super(self);
self.useShadow = hasNativeShadowDomSupport;
- self.schema = this.getModifiedSchema(schema);
return self;
} | fix: update component generator to be working as expected | bolt-design-system_bolt | train | js |
Subsets and Splits