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 |
|---|---|---|---|---|---|
24eefab8c7f658cfc0a2eb5a41be30fd9bf9bfce | diff --git a/spec/sample/provides_free_shipping_action_spec.rb b/spec/sample/provides_free_shipping_action_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/sample/provides_free_shipping_action_spec.rb
+++ b/spec/sample/provides_free_shipping_action_spec.rb
@@ -15,7 +15,7 @@ describe ProvidesFreeShippingAction do
end
context "when the order total with tax is <= 200" do
- specify "order gets free shipping" do
+ specify "order does not get free shipping" do
allow(order).to receive_messages(:total_with_tax => 200)
expect(order).not_to receive(:provide_free_shipping!) | Fix the spec description, order <=<I> should not have free shipping (#<I>) | adomokos_light-service | train | rb |
5ea8026ed8ccfbf4843eccbeeb83bb53f232b6cd | diff --git a/holoviews/core/pprint.py b/holoviews/core/pprint.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/pprint.py
+++ b/holoviews/core/pprint.py
@@ -20,6 +20,8 @@ class PrettyPrinter(object):
tab = ' '
+ type_formatter= ':{type}'
+
@classmethod
def pprint(cls, node):
return cls.serialize(cls.recurse(node))
@@ -43,8 +45,7 @@ class PrettyPrinter(object):
def component_type(cls, node):
"Return the type.group.label dotted information"
if node is None: return ''
- components = [':'+str(type(node).__name__)]
- return ".".join(components)
+ return cls.type_formatter.format(type=str(type(node).__name__))
@classmethod
def recurse(cls, node, attrpath=None, attrpaths=[], siblings=[], level=0, value_dims=True): | Added type formatter to improve customisation of pretty printing | pyviz_holoviews | train | py |
6d036d9e6f77a520fe6ea66af27ab3778348b4fc | diff --git a/src/org/jgroups/protocols/SEQUENCER.java b/src/org/jgroups/protocols/SEQUENCER.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/protocols/SEQUENCER.java
+++ b/src/org/jgroups/protocols/SEQUENCER.java
@@ -15,7 +15,8 @@ import java.util.concurrent.atomic.AtomicLong;
/**
- * Implementation of total order protocol using a sequencer. Consult doc/design/SEQUENCER.txt for details
+ * Implementation of total order protocol using a sequencer.
+ * Consult <a href="https://github.com/belaban/JGroups/blob/master/doc/design/SEQUENCER.txt">SEQUENCER.txt</a> for details
* @author Bela Ban
*/
@MBean(description="Implementation of total order protocol using a sequencer") | Updated ref to SEQUENCER design doc | belaban_JGroups | train | java |
32031a51a021a8464cc02f963e2279fe789f0ac8 | diff --git a/src/View.js b/src/View.js
index <HASH>..<HASH> 100644
--- a/src/View.js
+++ b/src/View.js
@@ -606,6 +606,10 @@ meta.setView = function(view)
}
}
+ if(view.isActive) {
+ return;
+ }
+
meta.view.detachAll();
meta.view.attach(view);
}; | Don't let to set already active view. | tenjou_meta2d | train | js |
3f57590bb4c8e8bf315f44af8d215253bfc77935 | diff --git a/treeherder/settings/base.py b/treeherder/settings/base.py
index <HASH>..<HASH> 100644
--- a/treeherder/settings/base.py
+++ b/treeherder/settings/base.py
@@ -175,6 +175,7 @@ CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
+
# default value when no task routing info is specified
CELERY_DEFAULT_QUEUE = 'default'
CELERY_DEFAULT_EXCHANGE_TYPE = 'direct'
@@ -261,6 +262,10 @@ BROKER_URL = 'amqp://{0}:{1}@{2}:{3}/{4}'.format(
RABBITMQ_VHOST
)
+CELERY_RESULT_BACKEND = BROKER_URL
+CELERY_RESULT_PERSISTANT = True
+CELERY_TASK_RESULT_EXPIRES = 43200
+
API_HOSTNAME = SITE_URL
BROWSERID_AUDIENCES = [SITE_URL] | set amqp as the CELERY_RESULT_BACKEND | mozilla_treeherder | train | py |
b1c552c9bf2d2a3d45bb77da24e4f10a2bd114e6 | diff --git a/vm.go b/vm.go
index <HASH>..<HASH> 100644
--- a/vm.go
+++ b/vm.go
@@ -250,8 +250,10 @@ func (s *stash) createBinding(name string) {
if s.names == nil {
s.names = make(map[string]uint32)
}
- s.names[name] = uint32(len(s.names))
- s.values = append(s.values, _undefined)
+ if _, exists := s.names[name]; !exists {
+ s.names[name] = uint32(len(s.names))
+ s.values = append(s.values, _undefined)
+ }
}
func (s *stash) deleteBinding(name string) bool {
diff --git a/vm_test.go b/vm_test.go
index <HASH>..<HASH> 100644
--- a/vm_test.go
+++ b/vm_test.go
@@ -42,6 +42,18 @@ func TestVM1(t *testing.T) {
}
+func TestEvalVar(t *testing.T) {
+ const SCRIPT = `
+ function test() {
+ var a;
+ return eval("var a = 'yes'; var z = 'no'; a;") === "yes" && a === "yes";
+ }
+ test();
+ `
+
+ testScript1(SCRIPT, valueTrue, t)
+}
+
var jumptable = []func(*vm, *instr){
f_jump,
f_halt, | Fixed variable mapping in eval() | dop251_goja | train | go,go |
1cc0a0a1837c63f4e46af981e870b85a7c3c7c38 | diff --git a/client/src/auth.js b/client/src/auth.js
index <HASH>..<HASH> 100644
--- a/client/src/auth.js
+++ b/client/src/auth.js
@@ -33,10 +33,10 @@ class FakeStorage {
}
function getStorage() {
- if (window.localStorage === undefined) {
- return new FakeStorage()
- }
try {
+ if (!window || window.localStorage === undefined) {
+ return new FakeStorage()
+ }
window.localStorage.setItem('$$fake', 1)
window.localStorage.removeItem('$$fake')
return window.localStorage | Move check for localStorage (#<I>)
* Move check for localStorage
Fixes #<I>
* Check for window existence first | rethinkdb_horizon | train | js |
e1a1f25d7d2d32990f81eefbafbaf872cccbf946 | diff --git a/django_extensions/templatetags/syntax_color.py b/django_extensions/templatetags/syntax_color.py
index <HASH>..<HASH> 100644
--- a/django_extensions/templatetags/syntax_color.py
+++ b/django_extensions/templatetags/syntax_color.py
@@ -37,13 +37,15 @@ __author__ = 'Will Larson <lethain@gmail.com>'
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
+from django.core.exceptions import ImproperlyConfigured
try :
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name,guess_lexer,ClassNotFound
except ImportError:
- raise Exception('Please, install \'pygments\' library to use syntax_color.')
+ raise ImproperlyConfigured(
+ "Please install 'pygments' library to use syntax_color.")
register = template.Library() | Raise ImproperlyConfigured instead when pygments not found | django-extensions_django-extensions | train | py |
66a0454adb1d408216f8429ef15dd6e75cb8f2f4 | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -347,6 +347,13 @@
* Removes a component from an entity. A soft remove (the default) will only
* refrain `.has()` from returning true. Hard will remove all
* associated properties and methods.
+ *
+ * @example
+ * ~~~
+ * var e = Crafty.e("2D,DOM,Test");
+ * e.removeComponent("Test"); //Soft remove Test component
+ * e.removeComponent("Test", false); //Hard remove Test component
+ * ~~~
*/
removeComponent: function (id, soft) {
if (soft === false) { | Added example to removeComponent doc | craftyjs_Crafty | train | js |
fe62ce513fdaf804b58656bfab0622ee3fadadbe | diff --git a/salt/minion.py b/salt/minion.py
index <HASH>..<HASH> 100644
--- a/salt/minion.py
+++ b/salt/minion.py
@@ -1477,8 +1477,12 @@ class Minion(MinionBase):
channel = salt.transport.Channel.factory(self.opts)
load = salt.utils.event.SaltEvent.unpack(package)[1]
load['tok'] = self.tok
- ret = channel.send(load)
- return ret
+ try:
+ ret = channel.send(load)
+ return ret
+ except SaltReqTimeoutError:
+ log.warning('Unable to send mine data to master.')
+ return None
@tornado.gen.coroutine
def handle_event(self, package): | Handle errors sending mine datas to master
Fix for #<I> | saltstack_salt | train | py |
02907aef4bd09fb0b1fb8c2ee28e69914d2c8739 | diff --git a/django_auth_ldap/models.py b/django_auth_ldap/models.py
index <HASH>..<HASH> 100644
--- a/django_auth_ldap/models.py
+++ b/django_auth_ldap/models.py
@@ -1,3 +1,4 @@
+from django.conf import settings
from django.db import models
@@ -26,6 +27,6 @@ class TestProfile(models.Model):
A user profile model for use by unit tests. This has nothing to do with the
authentication backend itself.
"""
- user = models.OneToOneField('auth.User')
+ user = models.OneToOneField(settings.AUTH_USER_MODEL)
is_special = models.BooleanField(default=False)
populated = models.BooleanField(default=False) | 'auth.User' changed to 'settings.AUTH_USER_MODEL' | django-auth-ldap_django-auth-ldap | train | py |
82c90f259ab951ac2be5fbacaf0b909fd99f18bb | diff --git a/lib/file_size_validator.rb b/lib/file_size_validator.rb
index <HASH>..<HASH> 100644
--- a/lib/file_size_validator.rb
+++ b/lib/file_size_validator.rb
@@ -35,7 +35,7 @@ class FileSizeValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
-
+
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
CHECKS.each do |key, validity_check|
@@ -43,8 +43,12 @@ class FileSizeValidator < ActiveModel::EachValidator
value ||= [] if key == :maximum
- value_size = value.size
- next if value_size.send(validity_check, check_value)
+ begin
+ value_size = value.size
+ next if value_size.send(validity_check, check_value)
+ rescue
+ next
+ end
errors_options = options.except(*RESERVED_OPTIONS)
errors_options[:file_size] = help.number_to_human_size check_value | protects value.size as it raises an exception in carrierwave with fog, this affectively disables file size validation for AWS uploads | wearefine_fae | train | rb |
6e52d809bfbfa4b1669b01345c5e3e59982ec789 | diff --git a/lib/active_admin/form_builder.rb b/lib/active_admin/form_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/form_builder.rb
+++ b/lib/active_admin/form_builder.rb
@@ -55,12 +55,7 @@ module ActiveAdmin
html << template.capture do
form_block = proc do |has_many_form|
- index = parent_child_index options[:parent] if options[:parent]
- block_contents = template.capture do
- block.call(has_many_form, index)
- end
- template.concat(block_contents)
- template.concat has_many_actions(has_many_form, builder_options, "".html_safe)
+ render_has_many_form(has_many_form, options[:parent], builder_options, &block)
end
template.assigns[:has_many_block] = true
@@ -81,6 +76,13 @@ module ActiveAdmin
protected
+ # Renders the Formtastic inputs then appends ActiveAdmin delete and sort actions.
+ def render_has_many_form(has_many_form, parent, builder_options, &block)
+ index = parent && parent_child_index(parent)
+ template.concat template.capture { has_many_form.instance_exec(has_many_form, index, &block) }
+ template.concat has_many_actions(has_many_form, builder_options, "".html_safe)
+ end
+
def has_many_actions(has_many_form, builder_options, contents)
if has_many_form.object.new_record?
contents << template.content_tag(:li) do | Extract method render_has_many_form. | activeadmin_activeadmin | train | rb |
b87aa3041de0109b7a5370b6694aed2cfb036803 | diff --git a/src/strategies/cached_strategy.js b/src/strategies/cached_strategy.js
index <HASH>..<HASH> 100644
--- a/src/strategies/cached_strategy.js
+++ b/src/strategies/cached_strategy.js
@@ -94,7 +94,11 @@
function flushTransportInfo() {
var storage = Pusher.Util.getLocalStorage();
if (storage && storage.pusherTransport) {
- delete storage.pusherTransport;
+ try {
+ delete storage.pusherTransport;
+ } catch(e) {
+ storage.pusherTransport = undefined;
+ }
}
} | Wrap localStorage deletion in a try/catch block | pusher_pusher-js | train | js |
f7fa8fcb475a99a580f4f90bb33d24eb2b0b5b3c | diff --git a/contrib/cortexutils/extractor.py b/contrib/cortexutils/extractor.py
index <HASH>..<HASH> 100644
--- a/contrib/cortexutils/extractor.py
+++ b/contrib/cortexutils/extractor.py
@@ -4,6 +4,10 @@ from builtins import str as unicode
import re
+class ExtractionError(Exception):
+ pass
+
+
class Extractor:
"""
The extractor class tries to detect ioc attribute types using regex-matching. Two functions are provided:
@@ -121,7 +125,7 @@ class Extractor:
:return: Data type of value, if known, else empty string
:rtype: str
"""
- if self.ignore and value in self.ignore:
+ if self.ignore and self.ignore in value:
return ''
if isinstance(value, (str, unicode)): | Fixes a bug in the extractor which made it return text instead of an emptry string. | TheHive-Project_Cortex-Analyzers | train | py |
62634b20876dac47844f0e1800b5e9fe70d6d233 | diff --git a/controller/src/main/java/org/jboss/as/controller/parsing/CommonXml.java b/controller/src/main/java/org/jboss/as/controller/parsing/CommonXml.java
index <HASH>..<HASH> 100644
--- a/controller/src/main/java/org/jboss/as/controller/parsing/CommonXml.java
+++ b/controller/src/main/java/org/jboss/as/controller/parsing/CommonXml.java
@@ -2003,8 +2003,8 @@ public abstract class CommonXml implements XMLElementReader<List<ModelNode>>, XM
writer.writeAttribute(Attribute.CODE.getLocalName(), code);
}
- if (vault.hasDefined(VAULT_OPTION)) {
- ModelNode properties = vault.get(VAULT_OPTION);
+ if (vault.hasDefined(VAULT_OPTIONS)) {
+ ModelNode properties = vault.get(VAULT_OPTIONS);
for (Property prop : properties.asPropertyList()) {
writer.writeEmptyElement(Element.VAULT_OPTION.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), prop.getName()); | AS7-<I>: Vault element is not written back
was: <I>c4bf4e<I>c<I>a0e<I>e<I>f2d4cd<I>a<I>f | wildfly_wildfly-core | train | java |
157ad6bcf4903b083b5ec2bcbd4bd5caa02fa988 | diff --git a/src/attributes.js b/src/attributes.js
index <HASH>..<HASH> 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -464,9 +464,7 @@ function getBytesPerValueForGLType(gl, type) {
return 0;
}
-/**
- * tries to get the number of elements from a set of arrays.
- */
+// Tries to get the number of elements from a set of arrays.
const positionKeys = ['position', 'positions', 'a_position'];
function getNumElementsFromNonIndexedArrays(arrays) {
let key; | Change helper function comment type as to not confuse grunt
/** comment */ was being confused as a docstring and resulting in TS declaration pollution | greggman_twgl.js | train | js |
e69edfffe1fee90f575caf5853809128406b0daf | diff --git a/src/main/java/org/nustaq/serialization/util/FSTInputStream.java b/src/main/java/org/nustaq/serialization/util/FSTInputStream.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/nustaq/serialization/util/FSTInputStream.java
+++ b/src/main/java/org/nustaq/serialization/util/FSTInputStream.java
@@ -29,7 +29,7 @@ import java.io.InputStream;
*/
public final class FSTInputStream extends InputStream {
- public static final boolean REPORT_READ_FAILS = false;
+ public static boolean REPORT_READ_FAILS = false;
private static final FSTLogger LOGGER = FSTLogger.getLogger(FSTInputStream.class); | REPORT_READ_FAILS is no longer final | RuedigerMoeller_fast-serialization | train | java |
2aac1b94a2e8a642a59cf01412fd8270c31cfd23 | diff --git a/src/Smalot/Magento/RemoteAdapter.php b/src/Smalot/Magento/RemoteAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Smalot/Magento/RemoteAdapter.php
+++ b/src/Smalot/Magento/RemoteAdapter.php
@@ -84,7 +84,7 @@ class RemoteAdapter implements RemoteAdapterInterface
$this->autoLogin = $autoLogin;
$this->setOptions($options);
- $this->soapClient = new \SoapClient($this->wsdl, $this->getOptions());
+ @$this->soapClient = new \SoapClient($this->wsdl, $this->getOptions());
}
/** | Add silent on soapclient constructor
An exception is thrown, that's enought | smalot_magento-client | train | php |
3984c9e63b95a5a0e0e2432b68530d40312207f5 | diff --git a/src/Database/SqlDialectTrait.php b/src/Database/SqlDialectTrait.php
index <HASH>..<HASH> 100644
--- a/src/Database/SqlDialectTrait.php
+++ b/src/Database/SqlDialectTrait.php
@@ -17,6 +17,7 @@ declare(strict_types=1);
namespace Cake\Database;
use Cake\Database\Expression\Comparison;
+use Cake\Database\Expression\IdentifierExpression;
use RuntimeException;
/**
diff --git a/tests/TestCase/Database/QueryTest.php b/tests/TestCase/Database/QueryTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Database/QueryTest.php
+++ b/tests/TestCase/Database/QueryTest.php
@@ -2874,7 +2874,8 @@ class QueryTest extends TestCase
$query = new Query($this->connection);
$query
- ->delete('authors')
+ ->delete()
+ ->from(['a' => 'authors'])
->where([
'OR' => [
'a.id' => 1, | Add missing "use" decleration and fix test | cakephp_cakephp | train | php,php |
02eef6c3f01b172b10fea6fb9d76e060f291f14a | diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py
index <HASH>..<HASH> 100644
--- a/openupgradelib/openupgrade.py
+++ b/openupgradelib/openupgrade.py
@@ -635,6 +635,12 @@ def rename_models(cr, model_spec):
cr,
'UPDATE mail_message SET model=%s where model=%s', (new, old),
)
+ if table_exists(cr, 'mail_message_subtype'):
+ logged_query(
+ cr,
+ 'UPDATE mail_message_subtype SET res_model=%s '
+ 'where res_model=%s', (new, old),
+ )
if table_exists(cr, 'mail_template'):
logged_query(
cr, | [IMP] rename_models: add mail_message_subtype in rename_models | OCA_openupgradelib | train | py |
d18c632768393c2997c4dfde6a758eb806013a11 | diff --git a/fullfat.js b/fullfat.js
index <HASH>..<HASH> 100644
--- a/fullfat.js
+++ b/fullfat.js
@@ -311,18 +311,25 @@ FullFat.prototype.merge = function(change) {
if (!f.versions[v] || f.versions[v].dist.shasum !== ver.dist.shasum) {
f.versions[v] = s.versions[v]
- if (pass)
- need.push(v)
+ need.push(v)
changed = true
- } else if (pass && !f._attachments[att]) {
+ } else if (!f._attachments[att]) {
need.push(v)
changed = true
}
}
for (var a in f._attachments) {
- var v = a.substr(f.name + 1).replace(/\.tgz$/, '')
- if (!pass || !f.versions[v]) {
+ var found = false
+ for (var v in f.versions) {
+ var tgz = f.versions[v].dist.tarball
+ var b = path.basename(url.parse(tgz).pathname)
+ if (b === a) {
+ found = true
+ break
+ }
+ }
+ if (!found) {
delete f._attachments[a]
changed = true
} | Handle tarballs that aren't called name-version.tgz
This can happen when the version is corrected to a proper SemVer <I>,
especially in cases of older packages with versions like <I>alpha
which should be <I>-alpha | npm_npm-fullfat-registry | train | js |
bf8cd0c92f180157a045c4c2495e409e258648fa | diff --git a/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java b/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java
+++ b/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java
@@ -564,8 +564,8 @@ public class ServerSupport extends AbstractVMSupport {
@Override
public void terminate(@Nonnull String vmId, String reason) throws InternalException, CloudException{
- terminateVm(vmId, null);
VirtualMachine vm = getVirtualMachine(vmId);
+ terminateVm(vmId, null);
terminateVmDisk(vmId, vm.getProviderDataCenterId());
} | Fix for issue just introduced where terminate a vm fails to clean up its
disk. | dasein-cloud_dasein-cloud-google | train | java |
addca5acf5c381dd3b0d1f8d00670ad7e4c4142c | diff --git a/code/Cropper/GD.php b/code/Cropper/GD.php
index <HASH>..<HASH> 100644
--- a/code/Cropper/GD.php
+++ b/code/Cropper/GD.php
@@ -21,12 +21,7 @@ class GD extends GenericCropper {
if(!$new) {
throw new GD_ResourceException();
}
-
- if ($extension == 'png') {
- imagealphablending($new, false );
- imagesavealpha($new, true);
- }
-
+
$resampleResult = imagecopyresampled(
$new,
$existing,
@@ -42,7 +37,7 @@ class GD extends GenericCropper {
if(!$resampleResult) {
throw new GD_CropException();
}
- $thumbFile = $this->saveCanvas($new, $extension);
+ $thumbFile = $this->saveCanvas($this->prepareCanvas($new), $extension);
$image->Filename = $thumbFile;
$image->write();
return $image;
@@ -73,6 +68,21 @@ class GD extends GenericCropper {
/**
* @param resource $canvas
* @param string $extension
+ * @return resource
+ */
+ public function prepareCanvas($canvas, $extension) {
+ switch($extension) {
+ case 'png':
+ imagealphablending($canvas, false);
+ imagesavealpha($canvas, true);
+ break;
+ }
+ return $canvas;
+ }
+
+ /**
+ * @param resource $canvas
+ * @param string $extension
*/
public function saveCanvas($canvas, $extension) {
$filename = $this->createThumbnailFilename(); | Add new public prepareCanvas method to handle edge cases for certain extensions | willmorgan_silverstripe-cropperfield | train | php |
70d7e654c4a1ddfa810f0cc4cb25bf38c24604f8 | diff --git a/test/elf/helper.rb b/test/elf/helper.rb
index <HASH>..<HASH> 100644
--- a/test/elf/helper.rb
+++ b/test/elf/helper.rb
@@ -15,6 +15,10 @@ module Elf
Vool::VoolCompiler.ruby_to_binary( "class Space;def main(arg);#{@input};end;end" )
writer = Elf::ObjectWriter.new(Risc.machine)
writer.save "test/#{file}.o"
+ end
+
+ def check_remote(file)
+ check(file)
stdout , exit_code = run_ssh(file)
@stdout = "" unless @stdout
assert_equal @stdout , stdout | only check object file creation in efl
remote execution only per request | ruby-x_rubyx | train | rb |
db6346e9bd7ece980257a0f37e895b2ea0faaef3 | diff --git a/tests/unit/test_metadata.py b/tests/unit/test_metadata.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_metadata.py
+++ b/tests/unit/test_metadata.py
@@ -315,12 +315,6 @@ class BytesTokensTest(unittest.TestCase):
self.assertEqual(bytes_token.hash_fn(str(cassandra.metadata.MAX_LONG)), str(cassandra.metadata.MAX_LONG))
self.assertEqual(str(bytes_token), "<BytesToken: -9223372036854775809>")
- try:
- bytes_token = BytesToken(cassandra.metadata.MIN_LONG - 1)
- self.fail('Tokens for ByteOrderedPartitioner should be only strings')
- except TypeError:
- pass
-
class KeyspaceMetadataTest(unittest.TestCase): | pass unit test on new BytesToken init; still need to expand tests | datastax_python-driver | train | py |
2edc7c1155181f1a9f80097970943cf5cda7e728 | diff --git a/test/test.typedarray.js b/test/test.typedarray.js
index <HASH>..<HASH> 100644
--- a/test/test.typedarray.js
+++ b/test/test.typedarray.js
@@ -44,7 +44,7 @@ describe( 'typed-array pdf', function tests() {
0.2952232515400824,
0.1697033786940394
]);
-
+console.log( actual, expected );
assert.isTrue( deepCloseTo( actual, expected, 1e-15 ) );
}); | [BUILD] remote debug. | distributions-io_weibull-pdf | train | js |
1f6d1b2a340e523033f1a0170ee66f4f90758b8d | diff --git a/src/components/chips/js/chipsController.js b/src/components/chips/js/chipsController.js
index <HASH>..<HASH> 100644
--- a/src/components/chips/js/chipsController.js
+++ b/src/components/chips/js/chipsController.js
@@ -190,7 +190,8 @@ MdChipsCtrl.prototype.init = function() {
this.deRegister.push(
this.$attrs.$observe('mdChipAppendDelay', function(newValue) {
- ctrl.chipAppendDelay = parseInt(newValue) || DEFAULT_CHIP_APPEND_DELAY;
+ var numberValue = parseInt(newValue);
+ ctrl.chipAppendDelay = isNaN(numberValue) ? DEFAULT_CHIP_APPEND_DELAY : numberValue;
})
);
}; | fix(chips): md-chip-append-delay of 0 does not get converted to <I> (#<I>)
Fixes #<I> | angular_material | train | js |
76fe2246c96e9981e6ec40d0062b1d8412d3ee37 | diff --git a/flatdict.py b/flatdict.py
index <HASH>..<HASH> 100644
--- a/flatdict.py
+++ b/flatdict.py
@@ -3,7 +3,7 @@ key/value pair mapping of nested dictionaries.
"""
__author__ = 'Gavin M. Roy <gavinmroy@gmail.com>'
-__version__ = '1.1.2'
+__version__ = '1.1.3'
class FlatDict(dict): | Bump the rev for the wheel dist | gmr_flatdict | train | py |
85dd092a8ee7c760c972a45c2cc94289d9155f03 | diff --git a/airflow/www/security.py b/airflow/www/security.py
index <HASH>..<HASH> 100644
--- a/airflow/www/security.py
+++ b/airflow/www/security.py
@@ -362,7 +362,7 @@ class AirflowSecurityManager(SecurityManager, LoggingMixin):
def _has_perm(self, permission_name, view_menu_name):
"""Whether the user has this perm"""
- if hasattr(self, 'perms'):
+ if hasattr(self, 'perms') and self.perms is not None:
if (permission_name, view_menu_name) in self.perms:
return True
# rebuild the permissions set | Make sure perms list isn't None before looking within list (#<I>) | apache_airflow | train | py |
2161dd383efd35dea8628dfed187d38b4317d364 | diff --git a/src/worker.js b/src/worker.js
index <HASH>..<HASH> 100644
--- a/src/worker.js
+++ b/src/worker.js
@@ -23,7 +23,7 @@ export class PoolWorker {
this.currentIndex = this.startIndex
this.limitIndex = limitIndex
}
- activate(): this {
+ activate(): PoolWorker {
this.active = true
return this
} | :art: Fix a return type in worker | steelbrain_range-pool | train | js |
984e9554cb4622a6fa153843a599cbfa2d69aa99 | diff --git a/odl/operator/operator.py b/odl/operator/operator.py
index <HASH>..<HASH> 100644
--- a/odl/operator/operator.py
+++ b/odl/operator/operator.py
@@ -1642,6 +1642,11 @@ class OperatorRightScalarMult(Operator):
'operator domain {!r}'
''.format(tmp, operator.domain))
+ if isinstance(operator, OperatorRightScalarMult):
+ # Shortcut to save performance in case of repeated multiplications
+ scalar = scalar * operator.scalar
+ operator = operator.operator
+
super().__init__(operator.domain, operator.range, operator.is_linear)
self.__operator = operator
self.__scalar = scalar | ENH: Add optimization for OperatorRightScalar mult repeatedly | odlgroup_odl | train | py |
01ab2764bce6f694dd1c7086c9fab8d62ea1ffc0 | diff --git a/java/server/src/org/openqa/selenium/remote/server/DefaultDriverSessions.java b/java/server/src/org/openqa/selenium/remote/server/DefaultDriverSessions.java
index <HASH>..<HASH> 100644
--- a/java/server/src/org/openqa/selenium/remote/server/DefaultDriverSessions.java
+++ b/java/server/src/org/openqa/selenium/remote/server/DefaultDriverSessions.java
@@ -47,6 +47,7 @@ public class DefaultDriverSessions implements DriverSessions {
put(DesiredCapabilities.htmlUnit(), "org.openqa.selenium.htmlunit.HtmlUnitDriver");
put(DesiredCapabilities.internetExplorer(), "org.openqa.selenium.ie.InternetExplorerDriver");
put(DesiredCapabilities.opera(), "com.opera.core.systems.OperaDriver");
+ put(DesiredCapabilities.operaBlink(), "org.openqa.selenium.opera.OperaDriver");
put(DesiredCapabilities.safari(), "org.openqa.selenium.safari.SafariDriver");
put(DesiredCapabilities.phantomjs(), "org.openqa.selenium.phantomjs.PhantomJSDriver");
}}; | Complete Selenium Java Server support for Blink based Opera | SeleniumHQ_selenium | train | java |
e01bf7aebe17c4d8ac6944d6d8505467e4fc33ed | diff --git a/wfdb/plot/plot.py b/wfdb/plot/plot.py
index <HASH>..<HASH> 100644
--- a/wfdb/plot/plot.py
+++ b/wfdb/plot/plot.py
@@ -942,7 +942,7 @@ def plot_wfdb(
ylabel,
record_name,
sig_units,
- ) = get_wfdb_plot_items(
+ ) = _get_wfdb_plot_items(
record=record, annotation=annotation, plot_sym=plot_sym
)
@@ -980,7 +980,7 @@ def plot_wfdb(
)
-def get_wfdb_plot_items(record, annotation, plot_sym):
+def _get_wfdb_plot_items(record, annotation, plot_sym):
"""
Get items to plot from WFDB objects. | wfdb.plot.plot: rename get_wfdb_plot_items to _get_wfdb_plot_items.
This function is not in the wfdb module, is not listed in the
documentation, and shouldn't be used by applications directly. | MIT-LCP_wfdb-python | train | py |
5af95a146113b4e7366dfd38a326ffe9d5e3e953 | diff --git a/PyTest/test_suite.py b/PyTest/test_suite.py
index <HASH>..<HASH> 100644
--- a/PyTest/test_suite.py
+++ b/PyTest/test_suite.py
@@ -49,7 +49,7 @@ class TestConnect(TestCase):
with self.assertRaises(BaseException):
connection.execute("Oh Boy!")
-class TestResultSet(TestCase):
+class TestDQL(TestCase):
def setUp(self):
self.connection = pydbc.connect(dsn)
@@ -73,6 +73,25 @@ class TestResultSet(TestCase):
row = self.cursor.fetchone()
self.assertIsNone(row)
+
+class TestDML(TestCase):
+
+ def setUp(self):
+ self.connection = pydbc.connect(dsn)
+ self.cursor = self.connection.cursor()
+
+ def tearDown(self):
+ self.cursor.close()
+ self.connection.close()
+
+ def test_delete_insert_select(self):
+ self.cursor.execute("delete from python_test")
+ self.cursor.execute("insert into python_test values (42)")
+ self.cursor.execute("select * from python_test")
+ row = self.cursor.fetchone()
+ self.assertItemsEqual(row, [42])
+
+
if __name__ == '__main__':
from unittest import main
main() | added round trip test case delte, insert, select | blue-yonder_turbodbc | train | py |
6aa7ebb8b8a21ca150dc55006b9798f5aeade1da | diff --git a/pysonos/core.py b/pysonos/core.py
index <HASH>..<HASH> 100755
--- a/pysonos/core.py
+++ b/pysonos/core.py
@@ -1290,6 +1290,7 @@ class SoCo(_SocoSingletonBase):
('DesiredLEDState', led_state),
])
+ # pylint: disable=too-many-branches
def get_current_track_info(self):
"""Get information about the currently playing track.
@@ -1336,6 +1337,17 @@ class SoCo(_SocoSingletonBase):
if index > -1:
track['artist'] = trackinfo[:index]
track['title'] = trackinfo[index + 3:]
+ elif trackinfo.startswith('BR P|TYPE=SNG'):
+ # Tagging used by e.g. SiriusXM:
+ # "BR P|TYPE=SNG|TITLE 7.15.17 LA|ARTIST Eagles|ALBUM "
+ tags = dict([p.split(" ", 1) for p in trackinfo.split("|")
+ if " " in p])
+ if tags.get("TITLE"):
+ track['title'] = tags["TITLE"]
+ if tags.get("ARTIST"):
+ track['artist'] = tags["ARTIST"]
+ if tags.get("ALBUM"):
+ track['album'] = tags["ALBUM"]
else:
# Might find some kind of title anyway in metadata
track['title'] = metadata.findtext('.//{http://purl.org/dc/' | Parse trackinfo from SiriusXM (#<I>) | amelchio_pysonos | train | py |
14460e22d9339a9c32a3cf352d50cf3e32d1d9a1 | diff --git a/source/PageAndMenu.js b/source/PageAndMenu.js
index <HASH>..<HASH> 100644
--- a/source/PageAndMenu.js
+++ b/source/PageAndMenu.js
@@ -45,10 +45,7 @@ export default class PageAndMenu extends Component
{
return (
<Context.Provider value={ this.state }>
- <div
- onTouchStart={ this.hideMenu }
- onMouseDown={ this.hideMenu }
- { ...this.props }/>
+ <div {...this.props}/>
</Context.Provider>
)
}
@@ -94,17 +91,5 @@ export default class PageAndMenu extends Component
return () => this.menuButton = undefined
}
- hideMenu = (event) => {
- if (!this.menu || !this.menuButton) {
- return
- }
- // Hide the menu only if clicked outside
- if (this.menu.element().contains(event.target)
- || this.menuButton.element().contains(event.target)) {
- return
- }
- this.toggleMenu(false)
- }
-
getTogglerNode = () => this.menuButton.element()
}
\ No newline at end of file | <PageAndMenu/> removed `hideMenu()` | catamphetamine_react-responsive-ui | train | js |
dc2f9bd7871b95194095c44a4d74f29ed927acb4 | diff --git a/lib/objects/modules/workspace_commands.rb b/lib/objects/modules/workspace_commands.rb
index <HASH>..<HASH> 100644
--- a/lib/objects/modules/workspace_commands.rb
+++ b/lib/objects/modules/workspace_commands.rb
@@ -87,7 +87,7 @@ module Bcome
raise Bcome::Exception::MethodInvocationRequiresParameter, "Please specify commands when invoking 'run'" if raw_commands.empty?
results = {}
- ssh_connect
+ ssh_connect(show_progress: true)
machines.pmap do |machine|
commands = machine.do_run(raw_commands) | Now showing ssh connection progress prior to a run | webzakimbo_bcome-kontrol | train | rb |
500805009ba845e3cfe5578ef43e7375275a7c74 | diff --git a/controller/src/main/java/org/jboss/as/controller/PathAddress.java b/controller/src/main/java/org/jboss/as/controller/PathAddress.java
index <HASH>..<HASH> 100644
--- a/controller/src/main/java/org/jboss/as/controller/PathAddress.java
+++ b/controller/src/main/java/org/jboss/as/controller/PathAddress.java
@@ -69,7 +69,7 @@ public class PathAddress implements Iterable<PathElement> {
String key = null;
for (ModelNode element : node.asList()) {
Property prop = null;
- if (element.getType() == ModelType.PROPERTY) {
+ if (element.getType() == ModelType.PROPERTY || element.getType() == ModelType.OBJECT) {
prop = element.asProperty();
}
else if (key == null) { | Let objects be properties
was: <I>d3ffc<I>aa7bdd<I>eced<I>de<I>e<I>ea<I>e9 | wildfly_wildfly-core | train | java |
03045f7afc7d15be35cbdedaadd590236c81a719 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -29,6 +29,24 @@ var SHIFT_LEFT_32 = (1 << 16) * (1 << 16),
// === READING =================================================================
+Protobuf.prototype.read = function(readField, end) {
+ var buf = this.buf;
+ end = end || buf.length;
+
+ while (this.pos < end) {
+ var val = this.readVarint(),
+ tag = val >> 3,
+ startPos = this.pos;
+ readField(tag);
+ if (this.pos === startPos) this.skip(val);
+ }
+};
+
+Protobuf.prototype.readMessage = function(readField) {
+ var bytes = this.readVarint();
+ this.read(readField, this.pos + bytes);
+}
+
Protobuf.prototype.readUInt32 = function() {
var val = this.buf.readUInt32LE(this.pos);
this.pos += 4; | add read and readMessage functions for some sugar | mapbox_pbf | train | js |
2ff9af09f30dc9657867c221fc46d6874e7bda23 | diff --git a/lib/mtgox/max_bid.rb b/lib/mtgox/max_bid.rb
index <HASH>..<HASH> 100644
--- a/lib/mtgox/max_bid.rb
+++ b/lib/mtgox/max_bid.rb
@@ -12,15 +12,15 @@ module MtGox
end
def up?
- price > previous_price.to_f
+ price.to_f > previous_price.to_f
end
def down?
- price < previous_price.to_f
+ price.to_f < previous_price.to_f
end
def changed?
- price != previous_price.to_f
+ price.to_f != previous_price.to_f
end
def unchanged?
diff --git a/lib/mtgox/min_ask.rb b/lib/mtgox/min_ask.rb
index <HASH>..<HASH> 100644
--- a/lib/mtgox/min_ask.rb
+++ b/lib/mtgox/min_ask.rb
@@ -12,15 +12,15 @@ module MtGox
end
def up?
- price > previous_price.to_f
+ price.to_f > previous_price.to_f
end
def down?
- price < previous_price.to_f
+ price.to_f < previous_price.to_f
end
def changed?
- price != previous_price.to_f
+ price.to_f != previous_price.to_f
end
def unchanged? | Convert both sides to a float | sferik_mtgox | train | rb,rb |
b4b3717591e1d1b43f1fdddca8e1d7437ab2eb59 | diff --git a/galpy/potential/Potential.py b/galpy/potential/Potential.py
index <HASH>..<HASH> 100644
--- a/galpy/potential/Potential.py
+++ b/galpy/potential/Potential.py
@@ -2991,7 +2991,7 @@ def _check_c(Pot,dxdv=False):
"""
Pot= flatten(Pot)
- from galpy.potential import planarPotential
+ from galpy.potential import planarPotential, linearPotential
if dxdv: hasC_attr= 'hasC_dxdv'
else: hasC_attr= 'hasC'
from .WrapperPotential import parentWrapperPotential
@@ -3000,7 +3000,8 @@ def _check_c(Pot,dxdv=False):
dtype='bool'))
elif isinstance(Pot,parentWrapperPotential):
return bool(Pot.__dict__[hasC_attr]*_check_c(Pot._pot))
- elif isinstance(Pot,Potential) or isinstance(Pot,planarPotential):
+ elif isinstance(Pot,Potential) or isinstance(Pot,planarPotential) \
+ or isinstance(Pot,linearPotential):
return Pot.__dict__[hasC_attr]
def _dim(Pot): | Add linearPotentials to _check_c Potential function, to allow C checking for C potentials | jobovy_galpy | train | py |
e3c45adc901468472b8f98f74c6731d6d06b6cb6 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index <HASH>..<HASH> 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,7 @@
### 0.5.1
+(August 18th, 2016)
+
- [Fix] Fixes `now()` not behaving properly when given a timezone.
- [Fix] Fixes double file opening when getting local timezone. (Thanks to [yggdr](https://github.com/yggdr))
- [Fix] Fixes `pt_BR` locale. (Thanks to [YomoFuno](https://github.com/YomoFuno))
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -60,7 +60,7 @@ author = 'Sébastien Eustace'
# The short X.Y version.
version = '0.5'
# The full version, including alpha/beta/rc tags.
-release = '0.5'
+release = '0.5.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pendulum/version.py b/pendulum/version.py
index <HASH>..<HASH> 100644
--- a/pendulum/version.py
+++ b/pendulum/version.py
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
-VERSION = '0.5'
+VERSION = '0.5.1' | Bumps version to <I> | sdispater_pendulum | train | md,py,py |
58c18cc50bf951d60617de8ba557e519cea64dbc | diff --git a/LiSE/LiSE/proxy.py b/LiSE/LiSE/proxy.py
index <HASH>..<HASH> 100644
--- a/LiSE/LiSE/proxy.py
+++ b/LiSE/LiSE/proxy.py
@@ -1513,7 +1513,6 @@ class CachingProxy(MutableMapping):
self._cache = self._get_state()
self._cache_valid = True
self.engine = engine_proxy
- self.engine.time_listener(self.invalidate)
self.exists = None
def __iter__(self): | Don't invalidate the cache anymore, we're too eager now | LogicalDash_LiSE | train | py |
1ef9fc00af1c17e1ea0bb310fad12003ca2cd467 | diff --git a/csv.go b/csv.go
index <HASH>..<HASH> 100644
--- a/csv.go
+++ b/csv.go
@@ -80,20 +80,21 @@ func csvFunc(r *rand.Rand, co *CSVOptions) ([]byte, error) {
}
// If the value is a point get the underlying value of the pointer
- rv := reflect.ValueOf(value)
- if rv.Kind() == reflect.Ptr {
- value = rv.Elem()
- }
+ // rv := reflect.ValueOf(value)
+ // if rv.Kind() == reflect.Ptr {
+ // value = rv.Elem()
+ // }
// If the value is a struct marshal it into a map[string]interface{}
- if reflect.TypeOf(value).Kind() == reflect.Struct {
- fmt.Printf("%+v\n", value)
+ if reflect.TypeOf(value).Kind() == reflect.Struct || reflect.TypeOf(value).Kind() == reflect.Ptr {
+ // fmt.Printf("%+v\n", value)
b, err := json.Marshal(value)
if err != nil {
return nil, err
}
- fmt.Println(string(b))
value = string(b)
+ // vr[ii] = fmt.Sprintf("%v", string(b))
+ // continue
}
if _, ok := value.([]byte); ok { | csv - work in progress | brianvoe_gofakeit | train | go |
c871b932cafdb99fd1138a11cf3d96d5e0a898cd | diff --git a/demands/__init__.py b/demands/__init__.py
index <HASH>..<HASH> 100644
--- a/demands/__init__.py
+++ b/demands/__init__.py
@@ -30,15 +30,14 @@ class HTTPServiceClient(Session):
def __init__(self, url, **kwargs):
super(HTTPServiceClient, self).__init__()
self.url = url
- self._shared_request_params = kwargs
if 'client_name' in kwargs:
- user_agent = '%s %s - %s' % (
+ kwargs.setdefault('headers', {})
+ kwargs['headers']['User-Agent'] = '%s %s - %s' % (
kwargs.get('client_name'),
kwargs.get('client_version', 'x.y.z'),
kwargs.get('app_name', 'unknown'),)
- self._shared_request_params.setdefault('headers', {})
- self._shared_request_params['headers']['User-Agent'] = user_agent
+ self._shared_request_params = kwargs
def _get_request_params(self, **kwargs):
"""Merge shared params and new params.""" | Remove intermediate var user_agent | yola_demands | train | py |
46b415c5f91039bc8cfcfba28a2e74d6f9929a68 | diff --git a/agent/lib/kontena/workers/node_info_worker.rb b/agent/lib/kontena/workers/node_info_worker.rb
index <HASH>..<HASH> 100644
--- a/agent/lib/kontena/workers/node_info_worker.rb
+++ b/agent/lib/kontena/workers/node_info_worker.rb
@@ -58,7 +58,7 @@ module Kontena::Workers
end
def publish_node_info
- info 'publishing node information'
+ debug 'publishing node information'
docker_info['PublicIp'] = self.public_ip
docker_info['PrivateIp'] = self.private_ip
docker_info['AgentVersion'] = Kontena::Agent::VERSION
diff --git a/agent/lib/kontena/workers/stats_worker.rb b/agent/lib/kontena/workers/stats_worker.rb
index <HASH>..<HASH> 100644
--- a/agent/lib/kontena/workers/stats_worker.rb
+++ b/agent/lib/kontena/workers/stats_worker.rb
@@ -46,7 +46,8 @@ module Kontena::Workers
end
def collect_stats
- info 'starting collection'
+
+ debug 'starting collection'
if response = get("/api/v1.2/subcontainers")
response.each do |data| | Moved some log messages to debug level (#<I>)
[Agent] Moved some agent log messages to debug level to reduce log spam | kontena_kontena | train | rb,rb |
a09c1cfeb8e0615c0e1cf92c7798305c815a5200 | diff --git a/tests/test_style_cases.py b/tests/test_style_cases.py
index <HASH>..<HASH> 100644
--- a/tests/test_style_cases.py
+++ b/tests/test_style_cases.py
@@ -61,3 +61,8 @@ def test_styles(filename, tree, style, expected_codes):
checker = _checker(filename, tree, style)
codes = [error.code for error in checker.check_order()]
assert codes == expected_codes
+
+
+def test_unknown_style():
+ with pytest.raises(LookupError):
+ lookup_entry_point('Unknown') | Test error case if an unknown style is configured | PyCQA_flake8-import-order | train | py |
39fbe00e6953289dc6914007b29a003cd30381c4 | diff --git a/src/components/connectAdvanced.js b/src/components/connectAdvanced.js
index <HASH>..<HASH> 100644
--- a/src/components/connectAdvanced.js
+++ b/src/components/connectAdvanced.js
@@ -107,6 +107,7 @@ export default function connectAdvanced(
dispatch: this.store.dispatch,
getState: dependsOnState ? this.store.getState : (() => null),
ref: withRef ? (ref => { this.wrappedInstance = ref }) : undefined,
+ WrappedComponent,
selectorFactory,
recomputationsProp,
methodName, | Add WrappedComponent as one of the option params passed to buildSelector(). Useful if one wanted to build a selector from the component's attributes, such as its propTypes, for example. | reduxjs_react-redux | train | js |
5595a82ee0683df4c502bc8e20c5deec1d463141 | diff --git a/spec/integration/application/apply_spec.rb b/spec/integration/application/apply_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/application/apply_spec.rb
+++ b/spec/integration/application/apply_spec.rb
@@ -131,6 +131,18 @@ end
expect(notices).to include('false')
expect(notices).not_to include('the Puppet::Type says hello')
end
+
+ it 'does not load the ruby type when when referenced from collector during compile' do
+ pending 'Fix for PUP-7674'
+ notices = eval_and_collect_notices("@applytest { 'applytest was here': }\nApplytest<| title == 'applytest was here' |>", node)
+ expect(notices).not_to include('the Puppet::Type says hello')
+ end
+
+ it 'does not load the ruby type when when referenced from exported collector during compile' do
+ pending 'Fix for PUP-7674'
+ notices = eval_and_collect_notices("@@applytest { 'applytest was here': }\nApplytest<<| |>>", node)
+ expect(notices).not_to include('the Puppet::Type says hello')
+ end
end
end | (PUP-<I>) Add tests to provoke resource collector load failure
This commit adds two tests that asserts that generated resource types
are loaded in favor of their corresponding ruby types during compile.
One test covers normal resource collections and the other uses a
collection for exported resources. | puppetlabs_puppet | train | rb |
ac855214c47d400226862db4e0a344ca7d4651db | diff --git a/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java b/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java
index <HASH>..<HASH> 100644
--- a/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java
+++ b/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java
@@ -464,7 +464,7 @@ public abstract class Selector {
try {
useMetaClass = true;
if (LOG_ENABLED) LOG.info("set meta class invocation path");
- Object receiver = args[0];
+ Object receiver = getCorrectedReceiver();
if (receiver instanceof Class) {
handle = LOOKUP.findVirtual(MetaClass.class, "invokeStaticMethod", MethodType.methodType(Object.class, Object.class, String.class, Object[].class));
handle = handle.bindTo(mc); | in case of null we always have to work on NullObject | apache_groovy | train | java |
1ce72df4fdba131a64914e94ff804173545fba5e | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -210,7 +210,7 @@ export default class Now extends EventEmitter {
}
}
- if (!quiet && deployment.nodeVersion) {
+ if (!quiet && deploymentType === 'npm' && deployment.nodeVersion) {
if (engines && engines.node) {
if (missingVersion) {
console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`) | show `Using Node.js` only for npm deployment type (#<I>) | zeit_now-cli | train | js |
4d24ee924baa6b3749872f416dfd2a40786ae875 | diff --git a/lib/opFns.js b/lib/opFns.js
index <HASH>..<HASH> 100644
--- a/lib/opFns.js
+++ b/lib/opFns.js
@@ -404,14 +404,14 @@ module.exports = {
stateManager.getContractStorage(runState.address, key, function (err, found) {
try {
- if (value.length === 0 && !found) {
+ if (value.length === 0 && !found.length) {
subGas(runState, new BN(fees.sstoreResetGas.v))
- } else if (value.length === 0 && found) {
+ } else if (value.length === 0 && found.length) {
subGas(runState, new BN(fees.sstoreResetGas.v))
runState.gasRefund.iadd(new BN(fees.sstoreRefundGas.v))
- } else if (value.length !== 0 && !found) {
+ } else if (value.length !== 0 && !found.length) {
subGas(runState, new BN(fees.sstoreSetGas.v))
- } else if (value.length !== 0 && found) {
+ } else if (value.length !== 0 && found.length) {
subGas(runState, new BN(fees.sstoreResetGas.v))
}
} catch (e) { | stateManager - fix contractStorage gas calc | ethereumjs_ethereumjs-vm | train | js |
bfd63a336e94c1fc4966c5a86ac38dfdcfad994e | diff --git a/openquake/nrmllib/hazard/writers.py b/openquake/nrmllib/hazard/writers.py
index <HASH>..<HASH> 100644
--- a/openquake/nrmllib/hazard/writers.py
+++ b/openquake/nrmllib/hazard/writers.py
@@ -452,10 +452,10 @@ class SESXMLWriter(object):
# * bottom right
# * bottom left
for el_name, corner in (
- ('topLeft', rupture.top_left_corner),
- ('topRight', rupture.top_right_corner),
- ('bottomRight', rupture.bottom_right_corner),
- ('bottomLeft', rupture.bottom_left_corner)):
+ ('topLeft', rupture.top_left_corner),
+ ('topRight', rupture.top_right_corner),
+ ('bottomRight', rupture.bottom_right_corner),
+ ('bottomLeft', rupture.bottom_left_corner)):
corner_elem = etree.SubElement(ps_elem, el_name)
corner_elem.set('lon', str(corner[0])) | hazard/writers:
Fixed a PEP8 indentation issue. | gem_oq-engine | train | py |
9804bbd4f71232f9cbb9c261f4b52e4ee31ae52e | diff --git a/packages/blueprint/lib/BaseController.js b/packages/blueprint/lib/BaseController.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint/lib/BaseController.js
+++ b/packages/blueprint/lib/BaseController.js
@@ -30,7 +30,7 @@ BaseController.prototype.checkSchemaThen = function (schema, then) {
function (callback) {
req.check (schema);
var errors = req.validationErrors ();
- var err = !errors ? null : new HttpError (400, 'validation_failed', 'Bad request', errors);
+ var err = !errors ? null : new HttpError (400, 'validation_failed', 'Bad request', {validation: errors});
return callback (err);
}, | Add the validation errors to the validation attribute in the details hash | onehilltech_blueprint | train | js |
ecb477952a6a74ce65469f97253bf2b31041fdba | diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV7.php b/src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV7.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV7.php
+++ b/src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV7.php
@@ -45,7 +45,7 @@ trait ConstraintTraitForV7
protected function exporter(): Exporter
{
- if (null !== $this->exporter) {
+ if (null === $this->exporter) {
$this->exporter = new Exporter();
} | Fix wrong check for exporter in ConstraintTrait | symfony_symfony | train | php |
79f0a35da7d4f75bb85d9c04513dd5929e21f75e | diff --git a/src/Intervention/Image/ImageServiceProviderLaravel4.php b/src/Intervention/Image/ImageServiceProviderLaravel4.php
index <HASH>..<HASH> 100755
--- a/src/Intervention/Image/ImageServiceProviderLaravel4.php
+++ b/src/Intervention/Image/ImageServiceProviderLaravel4.php
@@ -96,5 +96,7 @@ class ImageServiceProviderLaravel4 extends ServiceProvider
$app['image'] = $app->share(function ($app) {
return new ImageManager($app['config']->get('image::config'));
});
+
+ $app->alias('image', 'Intervention\Image\ImageManager');
}
}
diff --git a/src/Intervention/Image/ImageServiceProviderLaravel5.php b/src/Intervention/Image/ImageServiceProviderLaravel5.php
index <HASH>..<HASH> 100644
--- a/src/Intervention/Image/ImageServiceProviderLaravel5.php
+++ b/src/Intervention/Image/ImageServiceProviderLaravel5.php
@@ -51,6 +51,8 @@ class ImageServiceProviderLaravel5 extends ServiceProvider
$app['image'] = $app->share(function ($app) {
return new ImageManager($app['config']->get('image'));
});
+
+ $app->alias('image', 'Intervention\Image\ImageManager');
}
/** | Added IoC container alias to enable automatic dependency injection | Intervention_image | train | php,php |
96587d729e8ac663b7accfca87f17de208db7b78 | diff --git a/slither/slithir/operations/low_level_call.py b/slither/slithir/operations/low_level_call.py
index <HASH>..<HASH> 100644
--- a/slither/slithir/operations/low_level_call.py
+++ b/slither/slithir/operations/low_level_call.py
@@ -1,7 +1,7 @@
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.core.variables.variable import Variable
-from slither.core.declarations.solidity_variables import SolidityVariableComposed
+from slither.core.declarations.solidity_variables import SolidityVariable
from slither.slithir.variables.constant import Constant
@@ -11,7 +11,7 @@ class LowLevelCall(Call, OperationWithLValue):
"""
def __init__(self, destination, function_name, nbr_arguments, result, type_call):
- assert isinstance(destination, (Variable, SolidityVariableComposed))
+ assert isinstance(destination, (Variable, SolidityVariable))
assert isinstance(function_name, Constant)
super(LowLevelCall, self).__init__()
self._destination = destination | Use SolidityVariable in LowLevelCall (allow this) | crytic_slither | train | py |
9ae6b255ca8373413eb451afd9e52e21fafbc023 | diff --git a/cdpybio/analysis.py b/cdpybio/analysis.py
index <HASH>..<HASH> 100644
--- a/cdpybio/analysis.py
+++ b/cdpybio/analysis.py
@@ -1,3 +1,5 @@
+import pandas as pd
+
class SVD:
def __init__(self, df, mean_center=True, scale_variance=False):
""" | Bug fix
Needed to import pandas in analysis. | cdeboever3_cdpybio | train | py |
eb4be2bcc8e3c5eb3a33ebd172dfcb10013fc7cb | diff --git a/src/Indigo/Supervisor/Section/FcgiProgramSection.php b/src/Indigo/Supervisor/Section/FcgiProgramSection.php
index <HASH>..<HASH> 100644
--- a/src/Indigo/Supervisor/Section/FcgiProgramSection.php
+++ b/src/Indigo/Supervisor/Section/FcgiProgramSection.php
@@ -8,9 +8,9 @@ class FcgiProgramSection extends ProgramSection
{
public function __construct($name, array $options = array())
{
- parent::__construct($name, $options);
+ $this->resolveOptions($options);
- $this->name = 'fcgi' . $this->name;
+ $this->name = 'fcgi-program:' . $this->name;
}
/**
@@ -21,7 +21,13 @@ class FcgiProgramSection extends ProgramSection
parent::setDefaultOptions($resolver);
$resolver->setRequired(array('socket'));
-
- $resolver->setOptional(array('socket_owner', 'socket_mode'));
+ ->setOptional(array(
+ 'socket_owner',
+ 'socket_mode'
+ ))->setAllowedValues(array(
+ 'socket' => 'string',
+ 'socket_owner' => 'string',
+ 'socket_mode' => 'integer',
+ ));
}
} | FcgiProgramSection | supervisorphp_supervisor | train | php |
e2c586d4c357954d6c463e833e96bfda52c7affe | diff --git a/lib/builder-browserify.js b/lib/builder-browserify.js
index <HASH>..<HASH> 100644
--- a/lib/builder-browserify.js
+++ b/lib/builder-browserify.js
@@ -115,7 +115,9 @@ function initBundler (files, config) {
bundler.require(file, { entry: true })
})
- bundler = watchify(bundler)
+ bundler = watchify(bundler, {
+ ignoreWatch: true
+ })
return bundler
}
diff --git a/lib/control-app.js b/lib/control-app.js
index <HASH>..<HASH> 100644
--- a/lib/control-app.js
+++ b/lib/control-app.js
@@ -87,7 +87,9 @@ module.exports = function (config, cb) {
var clientBundler = browserify(tape, opt)
// we use watchify to speed up `.bundle()` calls
- clientBundler = watchify(clientBundler)
+ clientBundler = watchify(clientBundler, {
+ ignoreWatch: true
+ })
router.get('/airtap/client.js', function (req, res, next) {
res.contentType('application/javascript') | don't watch node_modules (#<I>) | airtap_airtap | train | js,js |
7b04110b14a1039aa30386239e964a3c25a39ec5 | diff --git a/src/Auth/CookieAuthenticate.php b/src/Auth/CookieAuthenticate.php
index <HASH>..<HASH> 100644
--- a/src/Auth/CookieAuthenticate.php
+++ b/src/Auth/CookieAuthenticate.php
@@ -4,6 +4,7 @@ namespace FOC\Authenticate\Auth;
use Cake\Auth\BaseAuthenticate;
use Cake\Controller\ComponentRegistry;
use Cake\Controller\Component\CookieComponent;
+use Cake\Event\Event;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Routing\Router;
@@ -120,10 +121,11 @@ class CookieAuthenticate extends BaseAuthenticate
/**
* Called from AuthComponent::logout()
*
+ * @param \Cake\Event\Event $event The dispatched Auth.logout event.
* @param array $user User record.
* @return void
*/
- public function logout(array $user)
+ public function logout(Event $event, array $user)
{
$this->_registry->Cookie->delete($this->_config['cookie']['name']);
} | Fix implemented event function logout
Fix implemented event function logout
s/Event/event
Fix docblock var and event capitaliation | FriendsOfCake_Authenticate | train | php |
03205e490a951cdb72d6d8b91cf60e127f7c3fad | diff --git a/Binary/Loader/GridFSLoader.php b/Binary/Loader/GridFSLoader.php
index <HASH>..<HASH> 100644
--- a/Binary/Loader/GridFSLoader.php
+++ b/Binary/Loader/GridFSLoader.php
@@ -40,6 +40,6 @@ class GridFSLoader implements LoaderInterface
throw new NotLoadableException(sprintf('Source image was not found with id "%s"', $id));
}
- return $image['file']->getBytes();
+ return $image->getFile()->getBytes();
}
} | Fix GridFSLoader
It seems that a previously suggested patch never made it into the repo (cf. issue #<I>) | liip_LiipImagineBundle | train | php |
ebbe2a284208926326967a9a0bb5fa60639ed042 | diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py
index <HASH>..<HASH> 100644
--- a/pandas/io/pytables.py
+++ b/pandas/io/pytables.py
@@ -2198,6 +2198,8 @@ class DataCol(IndexCol):
table=None,
meta=None,
metadata=None,
+ dtype=None,
+ data=None,
):
super().__init__(
name=name,
@@ -2212,8 +2214,8 @@ class DataCol(IndexCol):
meta=meta,
metadata=metadata,
)
- self.dtype = None
- self.data = None
+ self.dtype = dtype
+ self.data = data
@property
def dtype_attr(self) -> str:
@@ -3849,6 +3851,8 @@ class Table(Fixed):
meta = "category"
metadata = np.array(data_converted.categories, copy=False).ravel()
+ data, dtype_name = _get_data_and_dtype_name(data_converted)
+
col = klass(
name=adj_name,
cname=new_name,
@@ -3860,8 +3864,9 @@ class Table(Fixed):
ordered=ordered,
meta=meta,
metadata=metadata,
+ dtype=dtype_name,
+ data=data,
)
- col.set_data(data_converted)
col.update_info(self.info)
vaxes.append(col) | REF: pass dtype and data to pytables IndexCol constructor (#<I>) | pandas-dev_pandas | train | py |
c775dc4b9ebad6cf3b52122a8200b6597cf1086b | diff --git a/taffy.js b/taffy.js
index <HASH>..<HASH> 100644
--- a/taffy.js
+++ b/taffy.js
@@ -1800,6 +1800,7 @@ var TAFFY, exports, T;
});
}
else if ( T.isString( var2 ) || T.isNumber( var2 ) ){
+ re = false;
for ( n = 0; n < var1.length; n++ ){
re = T.has( var1[n], var2 );
if ( re ){ | Fix for zero length array checking
A fix for eroneously matches of zero length arrays will when using
'has' to search for strings in an array. | typicaljoe_taffydb | train | js |
a76f5f5ed251456d360d332258bcc4937d1c2494 | diff --git a/proxy/httpproxy/reverse.go b/proxy/httpproxy/reverse.go
index <HASH>..<HASH> 100644
--- a/proxy/httpproxy/reverse.go
+++ b/proxy/httpproxy/reverse.go
@@ -112,9 +112,10 @@ func (p *reverseProxy) ServeHTTP(rw http.ResponseWriter, clientreq *http.Request
closeNotifier, ok := rw.(http.CloseNotifier)
cancel := httputil.RequestCanceler(p.transport, proxyreq)
if ok {
+ closeCh := closeNotifier.CloseNotify()
go func() {
select {
- case <-closeNotifier.CloseNotify():
+ case <-closeCh:
atomic.StoreInt32(&requestClosed, 1)
log.Printf("proxy: client %v closed request prematurely", clientreq.RemoteAddr)
cancel() | httpproxy: fix race on getting close notifier channel
Fixes #<I> | etcd-io_etcd | train | go |
19a0d70820fbd0db57aabb471ab7ef725232597d | diff --git a/tests/Propel/Tests/Generator/Behavior/ConcreteInheritance/ConcreteInheritanceBehaviorTest.php b/tests/Propel/Tests/Generator/Behavior/ConcreteInheritance/ConcreteInheritanceBehaviorTest.php
index <HASH>..<HASH> 100644
--- a/tests/Propel/Tests/Generator/Behavior/ConcreteInheritance/ConcreteInheritanceBehaviorTest.php
+++ b/tests/Propel/Tests/Generator/Behavior/ConcreteInheritance/ConcreteInheritanceBehaviorTest.php
@@ -224,7 +224,7 @@ class ConcreteInheritanceBehaviorTest extends BookstoreTestBase
public function testPostDeleteCopyData()
{
- ConcreteArticleQuery::create()->deleteAll();
+ ConcreteArticleQuery::create()->deleteAll();
ConcreteQuizzQuery::create()->deleteAll();
ConcreteContentQuery::create()->deleteAll();
ConcreteCategoryQuery::create()->deleteAll();
@@ -234,8 +234,8 @@ class ConcreteInheritanceBehaviorTest extends BookstoreTestBase
$article->setConcreteCategory($category);
$article->save();
$id = $article->getId();
- $article->delete();
- $this->assertNull(ConcreteContentQuery::create()->findPk($id), 'delete() removes the parent record as well');
+ $article->delete();
+ $this->assertNull(ConcreteContentQuery::create()->findPk($id), 'delete() removes the parent record as well');
}
} | [Generator] [Tests] Fixed ConcreteInheritance tests | propelorm_Propel2 | train | php |
6dd929d298c969344cb33266c9ec86237e7e0628 | diff --git a/app/controllers/renalware/events/types_controller.rb b/app/controllers/renalware/events/types_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/renalware/events/types_controller.rb
+++ b/app/controllers/renalware/events/types_controller.rb
@@ -11,7 +11,7 @@ module Renalware
end
def create
- @event_type = Type.new(allowed_params)
+ @event_type = Type.new(event_params)
authorize @event_type
if @event_type.save
@@ -28,7 +28,7 @@ module Renalware
end
def update
- if @event_type.update(allowed_params)
+ if @event_type.update(event_params)
redirect_to events_types_path,
notice: "You have successfully updated patient event type"
else
@@ -44,8 +44,8 @@ module Renalware
private
- def allowed_params
- params.require(:event_type).permit(:name, :deleted_at)
+ def event_params
+ params.require(:events_type).permit(:name, :deleted_at)
end
def load_event_type | Amended/updated white list events_type params to be consistent in pattern to other similar controllers. | airslie_renalware-core | train | rb |
c21a34c57847690b474f4d40df45ed71b3bd141d | diff --git a/tasks/course.rb b/tasks/course.rb
index <HASH>..<HASH> 100644
--- a/tasks/course.rb
+++ b/tasks/course.rb
@@ -9,7 +9,7 @@ namespace :course do
COURSE_DIR = File.join(STATIC_DIR,'course')
desc "Build the JSON spec file for the course"
- task :specs do
+ task :spec do
File.open(File.join(COURSE_DIR,'specs.json'),'w') do |spec|
specs = [] | * Renamed the course:specs task to course:spec. | postmodern_spidr | train | rb |
7930d1a129e4834fdb1f32b1541b94b695aecf7a | diff --git a/src/ol/dom/dom.js b/src/ol/dom/dom.js
index <HASH>..<HASH> 100644
--- a/src/ol/dom/dom.js
+++ b/src/ol/dom/dom.js
@@ -140,7 +140,7 @@ ol.dom.setOpacity = function(element, value) {
// Fix to apply filter to absolutely-positioned children element
if (element.currentStyle.zIndex === 'auto') {
- element.style.zIndex = -1;
+ element.style.zIndex = 0;
}
} else {
goog.style.setOpacity(element, value);
@@ -167,7 +167,7 @@ ol.dom.setIEMatrix_ = function(element, value) {
// Fix to apply filter to absolutely-positioned children element
if (element.currentStyle.zIndex === 'auto') {
- element.style.zIndex = -1;
+ element.style.zIndex = 0;
}
}; | If the map has a background, zIndex=-1 puts the layers behind the background | openlayers_openlayers | train | js |
c776ea413e260dcbe150cc600d1d3f468446fdd0 | diff --git a/src/shiv/bootstrap/__init__.py b/src/shiv/bootstrap/__init__.py
index <HASH>..<HASH> 100644
--- a/src/shiv/bootstrap/__init__.py
+++ b/src/shiv/bootstrap/__init__.py
@@ -102,7 +102,7 @@ def extract_site_packages(archive, target_path, compile_pyc=False, compile_worke
"""
parent = target_path.parent
target_path_tmp = Path(parent, target_path.stem + ".tmp")
- lock = Path(parent, target_path.stem + ".lock")
+ lock = Path(parent, f".{target_path.stem}_lock")
# If this is the first time that a pyz is being extracted, we'll need to create the ~/.shiv dir
if not parent.exists():
diff --git a/src/shiv/bootstrap/filelock.py b/src/shiv/bootstrap/filelock.py
index <HASH>..<HASH> 100644
--- a/src/shiv/bootstrap/filelock.py
+++ b/src/shiv/bootstrap/filelock.py
@@ -87,11 +87,3 @@ class FileLock:
fcntl.flock(fd, fcntl.LOCK_UN)
os.close(fd)
-
- try:
- os.remove(self.lock_file)
-
- # Probably another instance of the application
- # that acquired the file lock.
- except OSError:
- pass | Don't delete lock files after release.
If multiple pyz executables are attempting to extract, deleting the lock
file after it's been unlocked causes a race condition where it may not
exist when accessed by a secondary process. | linkedin_shiv | train | py,py |
640f0fcb1bde04d6d2f302bfdf31b5441ae929eb | diff --git a/app/decorators/camaleon_cms/term_taxonomy_decorator.rb b/app/decorators/camaleon_cms/term_taxonomy_decorator.rb
index <HASH>..<HASH> 100644
--- a/app/decorators/camaleon_cms/term_taxonomy_decorator.rb
+++ b/app/decorators/camaleon_cms/term_taxonomy_decorator.rb
@@ -72,6 +72,7 @@ class CamaleonCms::TermTaxonomyDecorator < CamaleonCms::ApplicationDecorator
# return html link
# attrs: Hash of link tag attributes, sample: {id: "myid", class: "sss" }
def the_edit_link(title = nil, attrs = { })
+ return '' unless h.cama_current_user.present?
attrs = {target: "_blank", style: "font-size:11px !important;cursor:pointer;"}.merge(attrs)
h.link_to("→ #{title || h.ct("edit", default: 'Edit')}".html_safe, the_edit_url, attrs)
end | added session restriction for taxonomies -> the_edit_link() | owen2345_camaleon-cms | train | rb |
ad2f00df1d0386d9f1e3829ffb941f1717ac158c | diff --git a/pysc2/lib/features.py b/pysc2/lib/features.py
index <HASH>..<HASH> 100644
--- a/pysc2/lib/features.py
+++ b/pysc2/lib/features.py
@@ -197,8 +197,8 @@ class FeatureUnit(enum.IntEnum):
ideal_harvesters = 24
weapon_cooldown = 25
order_length = 26 # If zero, the unit is idle.
- order_id_0 = 27 # Currently unused.
- order_id_1 = 28 # Currently unused.
+ order_id_0 = 27
+ order_id_1 = 28
tag = 29 # Unique identifier for a unit (only populated for raw units).
hallucination = 30
buff_id_0 = 31
@@ -206,6 +206,10 @@ class FeatureUnit(enum.IntEnum):
addon_unit_type = 33
active = 34
is_on_screen = 35
+ order_progress_0 = 36
+ order_progress_1 = 37
+ order_id_2 = 38
+ order_id_3 = 39
class CargoUnit(enum.IntEnum):
@@ -1285,6 +1289,10 @@ class Features(object):
get_addon_type(u.add_on_tag) if u.add_on_tag else 0,
u.is_active,
u.is_on_screen,
+ int(u.orders[0].progress * 100) if len(u.orders) >= 1 else 0,
+ int(u.orders[1].progress * 100) if len(u.orders) >= 2 else 0,
+ raw_order(2),
+ raw_order(3),
]
return features | Add unit features for train/research order progress, and two more orders for a total of four.
PiperOrigin-RevId: <I> | deepmind_pysc2 | train | py |
567baee90d50c81568727b1513f3c82e871e8376 | diff --git a/lib/ruote/storage/fs_storage.rb b/lib/ruote/storage/fs_storage.rb
index <HASH>..<HASH> 100644
--- a/lib/ruote/storage/fs_storage.rb
+++ b/lib/ruote/storage/fs_storage.rb
@@ -22,7 +22,11 @@
# Made in Japan.
#++
-require 'yajl' rescue require 'json'
+begin
+ require 'yajl'
+rescue LoadError
+ require 'json'
+end
# gem install yajl-ruby OR json OR json_pure OR json-jruby
require 'rufus/json' | Fixing LoadError rescue. Didn't work on same line. | jmettraux_ruote | train | rb |
0f817d0d9065d853505f64d3e617b2c55e71cb18 | diff --git a/lib/outputlib.php b/lib/outputlib.php
index <HASH>..<HASH> 100644
--- a/lib/outputlib.php
+++ b/lib/outputlib.php
@@ -952,6 +952,7 @@ class theme_config {
// as support for it in browsers is at best quirky.
// When we choose to support SVG in background css we will need to remove this code and implement a solution that is
// either consistent or varies the URL for serving CSS depending upon SVG being used if available, or not.
+ $originalsvguse = $this->use_svg_icons();
$this->force_svg_use(false);
$replaced = array();
foreach ($matches as $match) {
@@ -966,6 +967,7 @@ class theme_config {
$imageurl = preg_replace('|^http.?://[^/]+|', '', $imageurl);
$css = str_replace($match[0], $imageurl, $css);
}
+ $this->force_svg_use($originalsvguse);
}
// now resolve all theme settings or do any other postprocessing | MDL-<I> usability: CSS post processing does not cancel SVG use | moodle_moodle | train | php |
3552484b91d8f2f75bc43fdd30fc117dc9df453a | diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -31,10 +31,10 @@ defined('MOODLE_INTERNAL') || die();
-$version = 2011061700.02; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2011062000.00; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
-$release = '2.1beta (Build: 20110617)'; // Human-friendly version name
+$release = '2.1beta (Build: 20110620)'; // Human-friendly version name
$maturity = MATURITY_BETA; // this version's maturity level | on-demand release <I>beta | moodle_moodle | train | php |
e280bcd618ffc1add861fe1eda2640842a4da880 | diff --git a/ui/plugins/controller.js b/ui/plugins/controller.js
index <HASH>..<HASH> 100644
--- a/ui/plugins/controller.js
+++ b/ui/plugins/controller.js
@@ -417,10 +417,15 @@ treeherder.controller('PluginCtrl', [
}
$http.get(url).then(function(resp) {
let action = resp.data;
+ let action_args = $interpolate('--project "{{project}}" --job "{{job}}" --treeherder-url "{{th}}"')({
+ project: $scope.repoName,
+ job: $scope.job.id,
+ th: (thServiceDomain || 'https://treeherder.mozilla.org') + '/api'
+ });
let template = $interpolate(action);
action = template({
action: 'backfill',
- action_args: '--project ' + $scope.repoName + ' --job ' + $scope.job.id,
+ action_args: action_args
});
let task = thTaskcluster.refreshTimestamps(jsyaml.safeLoad(action));
let taskId = tc.slugid(); | Bug <I> - Allow specific treeherder instance to be used in backfill (#<I>) r=camd | mozilla_treeherder | train | js |
2ecc8cd162a862f8930076055b1ce91cce3c74ae | diff --git a/src/org/zaproxy/zap/extension/sessions/ExtensionSessionManagement.java b/src/org/zaproxy/zap/extension/sessions/ExtensionSessionManagement.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/extension/sessions/ExtensionSessionManagement.java
+++ b/src/org/zaproxy/zap/extension/sessions/ExtensionSessionManagement.java
@@ -202,7 +202,9 @@ public class ExtensionSessionManagement extends ExtensionAdaptor implements Cont
@Override
public void exportContextData(Context ctx, Configuration config) {
- config.setProperty(CONTEXT_CONFIG_SESSION_TYPE, ctx.getSessionManagementMethod().getType().getUniqueIdentifier());
+ SessionManagementMethodType type = ctx.getSessionManagementMethod().getType();
+ config.setProperty(CONTEXT_CONFIG_SESSION_TYPE, type.getUniqueIdentifier());
+ type.exportData(config, ctx.getSessionManagementMethod());
}
@Override | Export context's session management data
Change ExtensionSessionManagement to also export session management data
when exporting the context (not a problem for core implementations which
do not have any data). | zaproxy_zaproxy | train | java |
4a250b3b7062e531955bcad3d017f998e60fe75f | diff --git a/packages/ember-handlebars/tests/handlebars_test.js b/packages/ember-handlebars/tests/handlebars_test.js
index <HASH>..<HASH> 100644
--- a/packages/ember-handlebars/tests/handlebars_test.js
+++ b/packages/ember-handlebars/tests/handlebars_test.js
@@ -876,12 +876,12 @@ test("Child views created using the view helper should have their IDs registered
var childView = firstChild(view);
var id = childView.$()[0].id;
- equal(Ember.View.views[id], childView, 'childView without passed ID is registered with Ember.View.views so that it can properly receive events from RootResponder');
+ equal(Ember.View.views[id], childView, 'childView without passed ID is registered with Ember.View.views so that it can properly receive events from EventDispatcher');
childView = nthChild(view, 1);
id = childView.$()[0].id;
equal(id, 'templateViewTest', 'precond -- id of childView should be set correctly');
- equal(Ember.View.views[id], childView, 'childView with passed ID is registered with Ember.View.views so that it can properly receive events from RootResponder');
+ equal(Ember.View.views[id], childView, 'childView with passed ID is registered with Ember.View.views so that it can properly receive events from EventDispatcher');
});
test("Child views created using the view helper and that have a viewName should be registered as properties on their parentView", function() { | Remove old reference to RootResponder | emberjs_ember.js | train | js |
0174c1c0ff56b019c1add45249a25a70fb7acdba | diff --git a/lib/dicom/link.rb b/lib/dicom/link.rb
index <HASH>..<HASH> 100644
--- a/lib/dicom/link.rb
+++ b/lib/dicom/link.rb
@@ -65,11 +65,9 @@ module DICOM
else
logger.error("Timed out while waiting for a release request. Closing the connection.")
end
- stop_session
- else
- # Properly release the association:
- handle_release
end
+ # Close the connection:
+ stop_session
end
# Builds the abort message which is transmitted when the server wishes to (abruptly) abort the connection. | Avoid double release on association reject
With the old behaviour we would get a double log entry of release request in DServer when there was an association reject. | dicom_ruby-dicom | train | rb |
d6fa8f0cef2a12c9164cf48c4b936bde621810e5 | diff --git a/chatterbot/trainers.py b/chatterbot/trainers.py
index <HASH>..<HASH> 100644
--- a/chatterbot/trainers.py
+++ b/chatterbot/trainers.py
@@ -328,7 +328,7 @@ class UbuntuCorpusTrainer(Trainer):
for file in glob.iglob(extracted_corpus_path):
self.logger.info('Training from: {}'.format(file))
- with open(file, 'r') as tsv:
+ with open(file, 'r', encoding='utf-8') as tsv:
reader = csv.reader(tsv, delimiter='\t')
statement_history = [] | Open Ubuntu corpus tsv as utf-8 | gunthercox_ChatterBot | train | py |
f54d2f92b96ee47a6ac1b177bdeaccb0dfb9b649 | diff --git a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConnection.java b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConnection.java
index <HASH>..<HASH> 100644
--- a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConnection.java
+++ b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConnection.java
@@ -117,7 +117,6 @@ public class DriverConnection implements AutoCloseable
this.lossHandler = lossHandler;
this.statusMessageSender = statusMessageSender;
this.statusMessageTimeout = statusMessageTimeout;
- this.lastSmTimestamp = 0;
final int termCapacity = rebuilders[0].capacity(); | [Java] Remove unnecessary initialisation. | real-logic_aeron | train | java |
002aadccb511bda455c883c8ed7d50eba846d95d | diff --git a/cgutils/cgroup.py b/cgutils/cgroup.py
index <HASH>..<HASH> 100644
--- a/cgutils/cgroup.py
+++ b/cgutils/cgroup.py
@@ -574,7 +574,7 @@ class CGroup:
fileops.mkdir(new_path)
new = get_cgroup(new_path)
if set_initparams:
- params = self.subsystem.get_init_parameters(self.parent.get_configs())
+ params = self.subsystem.get_init_parameters(self.get_configs())
for filename, value in params.iteritems():
new.set_config(filename, value)
return new | Fix setting initial values on mkdir
mkdir creates a directory under a subject cgroup itself. So initial
values of the subject have to be used, not ones of a parent of it. | peo3_cgroup-utils | train | py |
2a875f92fa1c75e307b2cb586992b274438f6da5 | diff --git a/future/standard_library/email/_encoded_words.py b/future/standard_library/email/_encoded_words.py
index <HASH>..<HASH> 100644
--- a/future/standard_library/email/_encoded_words.py
+++ b/future/standard_library/email/_encoded_words.py
@@ -113,7 +113,10 @@ def decode_b(encoded):
else:
padded_encoded = encoded
try:
- return base64.b64decode(padded_encoded, validate=True), defects
+ # The validate kwarg to b64decode is not supported in Py2.x
+ if not re.match(b'^[A-Za-z0-9+/]*={0,2}$', padded_encoded):
+ raise binascii.Error('Non-base64 digit found')
+ return base64.b64decode(padded_encoded), defects
except binascii.Error:
# Since we had correct padding, this must an invalid char error.
defects = [errors.InvalidBase64CharactersDefect()]
@@ -123,7 +126,7 @@ def decode_b(encoded):
for i in 0, 1, 2, 3:
try:
return base64.b64decode(encoded+b'='*i), defects
- except binascii.Error:
+ except (binascii.Error, TypeError): # Py2 raises a TypeError
if i==0:
defects.append(errors.InvalidBase64PaddingDefect())
else: | email._encoded_words: work-around for missing validate kwarg with base<I>.b<I>decode() on Py2.x | PythonCharmers_python-future | train | py |
61423789a10d78a78f50d12f2ce6c66860c7d59b | diff --git a/src/main/java/rx/internal/operators/OnSubscribeCombineLatest.java b/src/main/java/rx/internal/operators/OnSubscribeCombineLatest.java
index <HASH>..<HASH> 100644
--- a/src/main/java/rx/internal/operators/OnSubscribeCombineLatest.java
+++ b/src/main/java/rx/internal/operators/OnSubscribeCombineLatest.java
@@ -138,7 +138,6 @@ public final class OnSubscribeCombineLatest<T, R> implements OnSubscribe<R> {
* This will only allow one thread at a time to do the work, but ensures via `counter` increment/decrement
* that there is always once who acts on each `tick`. Same concept as used in OperationObserveOn.
*/
- @SuppressWarnings("unchecked")
void tick() {
if (WIP.getAndIncrement(this) == 0) {
int emitted = 0;
@@ -150,7 +149,7 @@ public final class OnSubscribeCombineLatest<T, R> implements OnSubscribe<R> {
if (buffer.isCompleted(o)) {
child.onCompleted();
} else {
- child.onNext(NotificationLite.<R>instance().getValue(o));
+ buffer.accept(o, child);
emitted++;
requested.decrementAndGet();
} | Slightly cleaner code for onNext from buffer | ReactiveX_RxJava | train | java |
c552ec9ac4e3238d4cd873485108f014725f2cbf | diff --git a/dimod/higherorder/utils.py b/dimod/higherorder/utils.py
index <HASH>..<HASH> 100644
--- a/dimod/higherorder/utils.py
+++ b/dimod/higherorder/utils.py
@@ -150,7 +150,7 @@ def make_quadratic(poly, strength, vartype=None, bqm=None):
bqm.info['reduction'] = {}
# we want to be able to mutate the polynomial so copy. We treat this as a
- # dict but by using BinaryPolynomail we also get automatic handling of
+ # dict but by using BinaryPolynomial we also get automatic handling of
# square terms
poly = BinaryPolynomial(poly, vartype=bqm.vartype)
variables = set().union(*poly)
@@ -195,9 +195,9 @@ def make_quadratic(poly, strength, vartype=None, bqm=None):
constraint.scale(strength)
for v, bias in constraint.linear.items():
try:
- poly[v,] += bias
+ poly[v, ] += bias
except KeyError:
- poly[v,] = bias
+ poly[v, ] = bias
for uv, bias in constraint.quadratic.items():
try:
poly[uv] += bias
@@ -221,7 +221,7 @@ def make_quadratic(poly, strength, vartype=None, bqm=None):
else:
# still has higher order terms, this shouldn't happen
raise RuntimeError
-
+
return bqm | Fix typos and minor pep8 issues | dwavesystems_dimod | train | py |
34b31adf5d2c1478465c10d7c53df3708ea057c8 | diff --git a/lib/jrubyfx/jfx_imports.rb b/lib/jrubyfx/jfx_imports.rb
index <HASH>..<HASH> 100644
--- a/lib/jrubyfx/jfx_imports.rb
+++ b/lib/jrubyfx/jfx_imports.rb
@@ -33,7 +33,7 @@ begin
end
# Java 8 (after b75) and above has JavaFX as part of the normal distib, only require it if we are 7 or below
jdk_version = ENV_JAVA["java.runtime.version"]
- require 'jfxrt.jar' if ENV['JFX_DIR'] or jdk_version.match(/^1\.[0-7]{1}\..*/) or jdk_version[10..11].to_i < 75
+ require 'jfxrt.jar' if ENV['JFX_DIR'] or jdk_version.match(/^1\.[0-7]{1}\..*/) or (jdk_version.match(/^1\.[8]{1}\..*/) and jdk_version.match(/-b(\d+)$/)[-1].to_i < 75)
testit = Java.javafx.application.Application
rescue LoadError, NameError
puts "JavaFX runtime not found. Please install Java 7u6 or newer or set environment variable JFX_DIR to the folder that contains jfxrt.jar " | More robust check. Also should be jdk9-proof (to the extent that
it will first check that it is jdk8 before checking the build number) | jruby_jrubyfx | train | rb |
5ab3991181997feb6d3f16105d664662d8815c5f | diff --git a/test/vtgatev2_test.py b/test/vtgatev2_test.py
index <HASH>..<HASH> 100755
--- a/test/vtgatev2_test.py
+++ b/test/vtgatev2_test.py
@@ -842,6 +842,7 @@ class TestFailures(unittest.TestCase):
"select 1 from vt_insert_test", {},
KEYSPACE_NAME, 'replica',
keyranges=[self.keyrange])
+ self.fail("DatabaseError should have been raised")
except Exception, e:
self.assertIsInstance(e, dbexceptions.DatabaseError)
self.assertNotIsInstance(e, dbexceptions.IntegrityError) | Testing to make sure some exception was raised. | vitessio_vitess | train | py |
6fd1e320fac44649f202a2c0c891e9b00d62e7bf | diff --git a/src/sos/targets_r.py b/src/sos/targets_r.py
index <HASH>..<HASH> 100644
--- a/src/sos/targets_r.py
+++ b/src/sos/targets_r.py
@@ -93,7 +93,7 @@ class R_library(BaseTarget):
#
if len(glob_wildcards('{repo}@{pkg}', [name])['repo']):
# package is from github
- self._install('remotes', None, repos)
+ self._install('remotes>=2.0.0', None, repos)
install_script = f'''
options(warn=-1)
package_repo <-strsplit("{name}", split="@")[[1]][2] | Ensure remotes <I>+ is available for previous patch | vatlab_SoS | train | py |
471bac7ba98dcfb589901e265d21c11414f3369b | diff --git a/src/Service/System/ApiExecutor.php b/src/Service/System/ApiExecutor.php
index <HASH>..<HASH> 100644
--- a/src/Service/System/ApiExecutor.php
+++ b/src/Service/System/ApiExecutor.php
@@ -33,7 +33,7 @@ use PSX\Http\Request;
use PSX\Http\Response;
use PSX\Http\Stream\Stream;
use PSX\Json\Parser;
-use PSX\Uri\Url;
+use PSX\Uri\Uri;
/**
* ApiExecutor
@@ -87,7 +87,7 @@ class ApiExecutor
{
$header = ['User-Agent' => Base::getUserAgent(), 'Authorization' => 'Bearer ' . $this->getAccessToken()];
$body = $body !== null ? Parser::encode($body) : null;
- $request = new Request(new Url('http://127.0.0.1/backend/' . $path), $method, $header, $body);
+ $request = new Request(new Uri('/backend/' . $path), $method, $header, $body);
$response = new Response();
$response->setBody(new Stream(fopen('php://memory', 'r+'))); | use uri in api executor | apioo_fusio-impl | train | php |
e582b184507e43f9a9ad3a7a05afcf08164be942 | diff --git a/digitalocean/Metadata.py b/digitalocean/Metadata.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Metadata.py
+++ b/digitalocean/Metadata.py
@@ -25,8 +25,7 @@ class Metadata(BaseAPI):
Customized version of get_data to directly get the data without
using the authentication method.
"""
- if "https" not in url:
- url = urljoin(self.end_point, url)
+ url = urljoin(self.end_point, url)
response = requests.get(url, headers=headers, params=params)
diff --git a/digitalocean/baseapi.py b/digitalocean/baseapi.py
index <HASH>..<HASH> 100644
--- a/digitalocean/baseapi.py
+++ b/digitalocean/baseapi.py
@@ -59,8 +59,7 @@ class BaseAPI(object):
if not self.token:
raise TokenError("No token provided. Please use a valid token")
- if "https" not in url:
- url = urljoin(self.end_point, url)
+ url = urljoin(self.end_point, url)
# lookup table to find out the apropriate requests method,
# headers and payload type (json or query parameters) | Use urljoin() unconditionally
The condition
if "https" not in url:
was meant to check if this is a full URL, but:
- it gives wrong answer for http:// URLs;
- it gives wrong answer for relative URLs that contain string "https" in
the path.
If urljoin() is given a full URL, it returns it unchanged, so the
condition is not necessary and can be removed. | koalalorenzo_python-digitalocean | train | py,py |
1bab356fbc59272d9e17f03e52930cd4574ffa0a | diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index <HASH>..<HASH> 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -1,6 +1,7 @@
"""Extensions to the 'distutils' for large or complex distributions"""
import os
+import sys
import functools
import distutils.core
import distutils.filelist
@@ -17,7 +18,7 @@ from setuptools.depends import Require
__all__ = [
'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require',
- 'find_packages'
+ 'find_packages',
]
__version__ = setuptools.version.__version__
@@ -171,5 +172,14 @@ def findall(dir=os.curdir):
return list(files)
-# fix findall bug in distutils (http://bugs.python.org/issue12885)
-distutils.filelist.findall = findall
+has_issue_12885 = (
+ sys.version_info < (3, 4, 6)
+ or
+ (3, 5) < sys.version_info <= (3, 5, 3)
+ or
+ (3, 6) < sys.version_info
+)
+
+if has_issue_12885:
+ # fix findall bug in distutils (http://bugs.python.org/issue12885)
+ distutils.filelist.findall = findall | Only apply findall patch on affected Pythons. | pypa_setuptools | train | py |
1c1068f3a968c403b6d3a414f9116070a5861b92 | diff --git a/src/axelitus/Base/DotArr.php b/src/axelitus/Base/DotArr.php
index <HASH>..<HASH> 100644
--- a/src/axelitus/Base/DotArr.php
+++ b/src/axelitus/Base/DotArr.php
@@ -97,6 +97,7 @@ class DotArr
foreach ($keys as $key) {
$return[$key] = static::get($arr, $key, $default);
}
+
return $return;
}
@@ -204,6 +205,7 @@ class DotArr
foreach ($keys as $key) {
$return[$key] = static::delete($arr, $key);
}
+
return $return;
}
@@ -259,6 +261,7 @@ class DotArr
foreach ($keys as $key) {
$return[$key] = static::keyExists($arr, $key);
}
+
return $return;
}
@@ -293,6 +296,7 @@ class DotArr
$return[] = $match;
$arr =& $arr[$k];
}
+
return $return;
}
} | Added a line break before the return statements. | axelitus_php-base | train | php |
1bb49824d0de69b5ec194ea5652dbadcc19815c3 | diff --git a/jmock/examples/calculator/src/org/jmock/examples/calculator/InfixParser.java b/jmock/examples/calculator/src/org/jmock/examples/calculator/InfixParser.java
index <HASH>..<HASH> 100644
--- a/jmock/examples/calculator/src/org/jmock/examples/calculator/InfixParser.java
+++ b/jmock/examples/calculator/src/org/jmock/examples/calculator/InfixParser.java
@@ -5,20 +5,18 @@ package org.jmock.examples.calculator;
import java.io.IOException;
/**
- * Grammar:
+ * A recursive descent parser for the following grammar:
* <pre>
* expr = add_expr
* add_expr = mul_expr ("+" add_expr | "-" add_expr)*
* mul_expr = mul_expr ("*" pow_expr | "/" pow_expr)*
* pow_expr = val_expr ("^" pow_expr)*
- * val_expr = number | varref | funcall | "(" expr ")"
+ * val_expr = number | varref | "(" expr ")"
* number ~= [0-9]+\.[0-9]+
* varref = identifier
- * funcall = identifier "(" expr_list ")"
* expr_list = expr ("," expr)*
* </pre>
*/
-
public class InfixParser implements Parser {
private ExpressionFactory factory; | Corrected the grammar in the javadoc comment | jmock-developers_jmock-library | train | java |
99d0187f924bb9b6df211083c315e49c51df9a19 | diff --git a/py3status/modules/timer.py b/py3status/modules/timer.py
index <HASH>..<HASH> 100644
--- a/py3status/modules/timer.py
+++ b/py3status/modules/timer.py
@@ -100,7 +100,7 @@ class Py3status:
# Hours
hours, t = divmod(t, 3600)
# Minutes
- mins, t = divmod(t, 60)
+ minutes, t = divmod(t, 60)
# Seconds
seconds = t
@@ -119,9 +119,9 @@ class Py3status:
'full_text': ':',
},
{
- 'full_text': make_2_didget(mins),
+ 'full_text': make_2_didget(minutes),
'color': self.color,
- 'index': 'mins',
+ 'index': 'minutes',
},
{
'full_text': ':',
@@ -146,7 +146,7 @@ class Py3status:
def on_click(self, event):
deltas = {
'hours': 3600,
- 'mins': 60,
+ 'minutes': 60,
'seconds': 1
}
index = event['index'] | timer: rename mins to minutes for cleaner docs | ultrabug_py3status | train | py |
91a7edaa5fd016f988a5040fdad5c0361154dc64 | diff --git a/src/effects/Effect.js b/src/effects/Effect.js
index <HASH>..<HASH> 100644
--- a/src/effects/Effect.js
+++ b/src/effects/Effect.js
@@ -115,6 +115,7 @@ export class Effect extends EventDispatcher {
* Call {@link Effect.setChanged} after changing macro definitions.
*
* @type {Map<String, String>}
+ * @protected
*/
this.defines = defines;
@@ -122,12 +123,10 @@ export class Effect extends EventDispatcher {
/**
* Shader uniforms.
*
- * You may freely modify the values of these uniforms at runtime. However, uniforms should not be removed or added
- * after the effect was created.
- *
* Call {@link Effect.setChanged} after adding or removing uniforms.
*
* @type {Map<String, Uniform>}
+ * @protected
*/
this.uniforms = uniforms;
@@ -138,6 +137,7 @@ export class Effect extends EventDispatcher {
* Call {@link Effect.setChanged} after adding or removing extensions.
*
* @type {Set<WebGLExtension>}
+ * @protected
*/
this.extensions = extensions;
@@ -145,9 +145,8 @@ export class Effect extends EventDispatcher {
/**
* The blend mode of this effect.
*
- * The result of this effect will be blended with the result of the previous effect using this blend mode.
- *
* @type {BlendMode}
+ * @protected
*/
this.blendMode = new BlendMode(blendFunction); | Make defines, uniforms, extensions and blendMode protected | vanruesc_postprocessing | train | js |
c5d955ccd2754750654714f034052f69a683753c | diff --git a/tests/Command/SyncCommandTest.php b/tests/Command/SyncCommandTest.php
index <HASH>..<HASH> 100644
--- a/tests/Command/SyncCommandTest.php
+++ b/tests/Command/SyncCommandTest.php
@@ -7,7 +7,6 @@
namespace lrackwitz\Para\Tests\Command;
use lrackwitz\Para\Command\SyncCommand;
-use lrackwitz\Para\Service\Sync\DefaultFileSyncer;
use lrackwitz\Para\Service\Sync\GitFileSyncer;
use lrackwitz\Para\Service\YamlConfigurationManager;
use PHPUnit\Framework\TestCase; | INFRA-<I>: Removed unnecessary dependency. | rackberg_para | train | php |
4301418952f91159b799e2a3e8cedaa75c06810d | diff --git a/lib/determinator/retrieve/routemaster.rb b/lib/determinator/retrieve/routemaster.rb
index <HASH>..<HASH> 100644
--- a/lib/determinator/retrieve/routemaster.rb
+++ b/lib/determinator/retrieve/routemaster.rb
@@ -46,7 +46,7 @@ module Determinator
target_groups: obj.body.target_groups.map { |tg|
TargetGroup.new(
rollout: tg.rollout,
- constraints: tg.constraints.to_h
+ constraints: tg.constraints.first.to_h
)
},
variants: obj.body.variants.to_h,
diff --git a/spec/determinator/retrieve/routemaster_spec.rb b/spec/determinator/retrieve/routemaster_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/determinator/retrieve/routemaster_spec.rb
+++ b/spec/determinator/retrieve/routemaster_spec.rb
@@ -31,12 +31,12 @@ describe Determinator::Retrieve::Routemaster do
target_groups: [
{
rollout: 32_768,
- constraints: {}
+ constraints: []
},{
rollout: 1_000,
- constraints: {
+ constraints: [{
type: 'value'
- }
+ }]
}
],
variants: { | Fixes fetching constraints from Routemaster | deliveroo_determinator | train | rb,rb |
232599c2058707befe01d589d1487f0361485abc | diff --git a/worker/upgradedatabase/manifold.go b/worker/upgradedatabase/manifold.go
index <HASH>..<HASH> 100644
--- a/worker/upgradedatabase/manifold.go
+++ b/worker/upgradedatabase/manifold.go
@@ -29,7 +29,7 @@ type ManifoldConfig struct {
// Validate returns an error if the manifold config is not valid.
func (cfg ManifoldConfig) Validate() error {
if cfg.UpgradeDBGateName == "" {
- return errors.NotValidf("emtpy UpgradeDBGateName")
+ return errors.NotValidf("empty UpgradeDBGateName")
}
if cfg.Logger == nil {
return errors.NotValidf("nil Logger") | Fixes spelling of "empty" in upgradedatabase worker manifold. | juju_juju | train | go |
2f8a591b424df094750b49f336817e6b5bc5e141 | diff --git a/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java b/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
+++ b/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
@@ -266,7 +266,12 @@ public class XmlFileParsingTest extends AbstractInfinispanTest {
assert c.getLockAcquisitionTimeout() == 20000;
assert c.getConcurrencyLevel() == 1000;
assert c.getIsolationLevel() == IsolationLevel.REPEATABLE_READ;
-
+
+ c = defaultCfg.clone();
+ c.applyOverrides(namedCaches.get("lazyDeserialization"));
+ assert c.isUseLazyDeserialization();
+ assert !c.isExposeJmxStatistics();
+
c = defaultCfg.clone();
Configuration configurationWL = namedCaches.get("withLoader");
configurationWL.getCacheLoaderManagerConfig().setShared(true); | [ISPN-<I>] (Configuration overrides for boolean types getting mixed up) Failing test committed. | infinispan_infinispan | train | java |
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.