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 |
|---|---|---|---|---|---|
d8255402dfb234c2d0f66cd07c5e07b2851677e7 | diff --git a/angularFire.js b/angularFire.js
index <HASH>..<HASH> 100644
--- a/angularFire.js
+++ b/angularFire.js
@@ -262,7 +262,7 @@ angular.module("firebase").factory("angularFireAuth", [
}
}
- function authRequiredRedirect(route, path) {
+ function authRequiredRedirect(route, path, self) {
if(route.authRequired && !self._authenticated){
if(route.pathTo === undefined) {
self._redirectTo = $location.path();
@@ -294,10 +294,10 @@ angular.module("firebase").factory("angularFireAuth", [
this._redirectTo = null;
this._authenticated = false;
if (options.path) {
- authRequiredRedirect($route.current, options.path);
+ authRequiredRedirect($route.current, options.path, self);
$rootScope.$on("$routeChangeStart", function(e, next, current) {
- authRequiredRedirect(next, options.path);
+ authRequiredRedirect(next, options.path, self);
});
} | Fix for issue #<I> part 2 | firebase_angularfire | train | js |
ca35ccef49feff9be5ee51d4c5753523edc37d70 | diff --git a/mcpack/datapack.py b/mcpack/datapack.py
index <HASH>..<HASH> 100644
--- a/mcpack/datapack.py
+++ b/mcpack/datapack.py
@@ -146,6 +146,8 @@ class Recipe(JsonItem):
experience: Optional[float] = None
cookingtime: Optional[int] = None
count: Optional[int] = None
+ base: Optional[dict] = None
+ addition: Optional[dict] = None
StructureSchema = schema('StructureSchema', { | Update Recipe to reflect changes made in Mc <I> | vberlier_mcpack | train | py |
dd7ae027cc893e6080d6812f74b8fa47fecae603 | diff --git a/moto/ecs/models.py b/moto/ecs/models.py
index <HASH>..<HASH> 100644
--- a/moto/ecs/models.py
+++ b/moto/ecs/models.py
@@ -108,10 +108,10 @@ class ContainerInstance(BaseObject):
return response_object
-class Failure(BaseObject):
- def __init__(self, reason, arn):
+class ContainerInstanceFailure(BaseObject):
+ def __init__(self, reason, container_instance_id):
self.reason = reason
- self.arn = arn
+ self.arn = "arn:aws:ecs:us-east-1:012345678910:container-instance/{0}".format(container_instance_id)
@property
def response_object(self):
@@ -275,7 +275,7 @@ class EC2ContainerServiceBackend(BaseBackend):
if container_instance is not None:
container_instance_objects.append(container_instance)
else:
- failures.append(Failure(reason='MISSING', arn=container_instance_arn))
+ failures.append(ContainerInstanceFailure('MISSING', container_instance_id))
return container_instance_objects, failures | rename class Failure to ContainerInstanceFailure | spulec_moto | train | py |
90bda23d800c72ee9d262c2430f9c731f967863a | diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/session.rb
+++ b/lib/capybara/session.rb
@@ -62,7 +62,7 @@ module Capybara
def fill_in(locator, options={})
msg = "cannot fill in, no text field, text area or password field with id, name, or label '#{locator}' found"
- raise "Must pass a hash containing 'with'" unless options.kind_of? Hash && !options.index(:with).nil?
+ raise "Must pass a hash containing 'with'" if not options.is_a?(Hash) or not options.has_key?(:with)
locate(:xpath, XPath.fillable_field(locator), msg).set(options[:with])
end | unless is never a good idea | teamcapybara_capybara | train | rb |
a43c544c551ba756afacc4b8ca7afabb87717158 | diff --git a/Classes/System/Solr/Node.php b/Classes/System/Solr/Node.php
index <HASH>..<HASH> 100644
--- a/Classes/System/Solr/Node.php
+++ b/Classes/System/Solr/Node.php
@@ -187,7 +187,7 @@ class Node {
{
$pathWithoutLeadingAndTrailingSlashes = trim(trim($this->path), "/");
$pathWithoutLastSegment = substr($pathWithoutLeadingAndTrailingSlashes, 0, strrpos($pathWithoutLeadingAndTrailingSlashes, "/"));
- return '/' . $pathWithoutLastSegment . '/';
+ return ($pathWithoutLastSegment === '') ? '/' : '/' . $pathWithoutLastSegment . '/';
}
/** | [BUGFIX:PORT:master] Build core base path right, when path is slash only
Fixes: #<I> | TYPO3-Solr_ext-solr | train | php |
c6bd6115d51d86a312ca21f1013b6e6b71e06679 | diff --git a/Model/Behavior/FileValidationBehavior.php b/Model/Behavior/FileValidationBehavior.php
index <HASH>..<HASH> 100644
--- a/Model/Behavior/FileValidationBehavior.php
+++ b/Model/Behavior/FileValidationBehavior.php
@@ -333,6 +333,7 @@ class FileValidationBehavior extends ModelBehavior {
public function afterValidate(Model $model) {
if ($this->_tempFile) {
$this->_tempFile->delete();
+ $this->_tempFile = null;
}
return true; | Reset property so it doesn't leak to other models
If the FileValidation is used in multiple models which are validated
within a single request, since Behaviours are effectively singletons,
their internal state leaks over to the next model.
This prevents $_tmpFile still being set for the next model; otherwise
this file would be tried to be deleted again in the next model validation
which does not exist anymore. | milesj_uploader | train | php |
95c98799a4871fb3eb92729d0a3db72a823b070a | diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -258,7 +258,7 @@ module Rails
end
def create_public_files
- build(:public)
+ build(:public_directory)
end
def create_public_image_files | Fix a bug in the generators from the previous commit | rails_rails | train | rb |
8b4f852f8eca6164bf5138505f07e97543de737b | diff --git a/lib/megam/api/version.rb b/lib/megam/api/version.rb
index <HASH>..<HASH> 100644
--- a/lib/megam/api/version.rb
+++ b/lib/megam/api/version.rb
@@ -15,6 +15,6 @@
#
module Megam
class API
- VERSION = "1.5.beta1"
+ VERSION = "1.5.beta2"
end
end | Yanked <I>beta1, and upgraded version to <I>.beta2 | megamsys_megam_api | train | rb |
64c2dd07e01fae18aac742dd01dee5c8c996954f | diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -42,7 +42,8 @@ class Chef
end
def run_start(version)
- puts_line "Starting Chef Client, version #{version}"
+ puts_line "Starting Chef Client#{" (FIPS mode)" if Chef::Config[:openssl_fips]}" \
+ ", version #{version}"
end
def total_resources
diff --git a/lib/chef/formatters/minimal.rb b/lib/chef/formatters/minimal.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/formatters/minimal.rb
+++ b/lib/chef/formatters/minimal.rb
@@ -29,7 +29,8 @@ class Chef
# Called at the very start of a Chef Run
def run_start(version)
- puts "Starting Chef Client, version #{version}"
+ puts_line "Starting Chef Client#{" (FIPS mode)" if Chef::Config[:openssl_fips]}" \
+ ", version #{version}"
end
# Called at the end of the Chef run. | Add fips mode line to Starting chef client run | chef_chef | train | rb,rb |
68da2f9f7374a658e0c28a24b41824fd31f8da9e | diff --git a/lib/active_scaffold/actions/core.rb b/lib/active_scaffold/actions/core.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/actions/core.rb
+++ b/lib/active_scaffold/actions/core.rb
@@ -69,13 +69,16 @@ module ActiveScaffold::Actions
@record.id = id
else
@record = params[:id] ? find_if_allowed(params[:id], :update) : new_model
- apply_constraints_to_record(@record) if @record.new_record?
- @record.id = nil
+ if @record.new_record?
+ apply_constraints_to_record(@record)
+ else
+ @record = @record.dup
+ end
value = column_value_from_param_value(@record, @column, params.delete(:value))
@record.send "#{@column.name}=", value
@record.id = params[:id]
end
- set_parent(@record) if @record.new_record? && params[:parent_controller] && params[:parent_id] && params[:child_association]
+ set_parent(@record) if @record.id.nil? && params[:parent_controller] && params[:parent_id] && params[:child_association]
after_render_field(@record, @column)
end | fix refresh_link on has_many associations | activescaffold_active_scaffold | train | rb |
3108626e7aba33765ff947d4c6edc06cde391922 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ tests_require = [
setup(
name='django-geoip',
- version='0.2.3dev',
+ version='0.2.3',
author='Ilya Baryshev',
author_email='baryshev@gmail.com',
packages=find_packages(exclude=("tests")), | Bumped version to <I> | futurecolors_django-geoip | train | py |
cbdf88a96803b8e3468b9697ebacd2b31455b6cc | diff --git a/dockerclient/client.go b/dockerclient/client.go
index <HASH>..<HASH> 100644
--- a/dockerclient/client.go
+++ b/dockerclient/client.go
@@ -129,12 +129,9 @@ func NewClientExecutor(client *docker.Client) *ClientExecutor {
}
func (e *ClientExecutor) DefaultExcludes() error {
- excludes, err := imagebuilder.ParseDockerignore(e.Directory)
- if err != nil {
- return err
- }
- e.Excludes = append(excludes, ".dockerignore")
- return nil
+ var err error
+ e.Excludes, err = imagebuilder.ParseDockerignore(e.Directory)
+ return err
}
// WithName creates a new child executor that will be used whenever a COPY statement | Copy .dockerignore into image for compatibility with Docker | openshift_imagebuilder | train | go |
bff5722ac2fcd720d86e4999b541a4c3a0046aa7 | diff --git a/lib/netsuite/records/invoice.rb b/lib/netsuite/records/invoice.rb
index <HASH>..<HASH> 100644
--- a/lib/netsuite/records/invoice.rb
+++ b/lib/netsuite/records/invoice.rb
@@ -25,6 +25,8 @@ module NetSuite
:to_be_printed, :total, :total_cost_estimate, :tracking_numbers, :tran_date, :tran_id, :tran_is_vsoe_bundle,
:transaction_bill_address, :transaction_ship_address, :vat_reg_num, :vsoe_auto_calc
+ attr_reader :internal_id, :external_id
+
def initialize(attributes = {})
@internal_id = attributes.delete(:internal_id)
@external_id = attributes.delete(:external_id) | invoice should have readers for internal and external ids | NetSweet_netsuite | train | rb |
d459adf02a64b5e0e53986a50408e6adbba2cd46 | diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -1,5 +1,6 @@
require 'puppet/util/logging'
require 'semver'
+require 'json'
# Support for modules
class Puppet::Module
@@ -57,8 +58,8 @@ class Puppet::Module
return false unless Puppet::FileSystem.exist?(metadata_file)
begin
- metadata = PSON.parse(File.read(metadata_file))
- rescue PSON::PSONError => e
+ metadata = JSON.parse(File.read(metadata_file))
+ rescue JSON::JSONError => e
Puppet.debug("#{name} has an invalid and unparsable metadata.json file. The parse error: #{e.message}")
return false
end
@@ -112,7 +113,7 @@ class Puppet::Module
end
def load_metadata
- @metadata = data = PSON.parse(File.read(metadata_file))
+ @metadata = data = JSON.parse(File.read(metadata_file))
@forge_name = data['name'].gsub('-', '/') if data['name']
[:source, :author, :version, :license, :puppetversion, :dependencies].each do |attr| | (PUP-<I>) Restore use of JSON (over PSON).
In master, we've officially introduced a dependency on the JSON library,
but the previous commit in this branch unintentionally reverted a part
of that commit due to merge conflicts.
This commit restores the use of the JSON library where it had been
previously removed. | puppetlabs_puppet | train | rb |
73e59571b49a0d31d2b3305ebb784e7b2cf384d6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -148,7 +148,7 @@ setup(name = 'GPy',
include_package_data = True,
py_modules = ['GPy.__init__'],
test_suite = 'GPy.testing',
- install_requires = ['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz>=0.6.8'],
+ install_requires = ['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz>=0.6.9'],
extras_require = {'docs':['sphinx'],
'optional':['mpi4py',
'ipython>=4.0.0', | chg: version update on paramz | SheffieldML_GPy | train | py |
a213908aa5b7641de9533f0886fb86ca39020562 | diff --git a/lfs/batcher_test.go b/lfs/batcher_test.go
index <HASH>..<HASH> 100644
--- a/lfs/batcher_test.go
+++ b/lfs/batcher_test.go
@@ -7,7 +7,7 @@ import (
)
func TestBatcherSizeMet(t *testing.T) {
- assertAll([]batcherTestCase{
+ runBatcherTests([]batcherTestCase{
{2, 4, false},
{3, 5, false},
{0, 0, false},
@@ -15,7 +15,7 @@ func TestBatcherSizeMet(t *testing.T) {
}
func TestBatcherExit(t *testing.T) {
- assertAll([]batcherTestCase{
+ runBatcherTests([]batcherTestCase{
{2, 4, true},
{3, 5, true},
{0, 0, true},
@@ -56,9 +56,9 @@ func (b batcherTestCase) Batches() int {
return b.ItemCount / b.BatchSize
}
-// assertAll processes all test cases, throwing assertion errors if they
+// runBatcherTests processes all test cases, throwing assertion errors if they
// fail.
-func assertAll(cases []batcherTestCase, t *testing.T) {
+func runBatcherTests(cases []batcherTestCase, t *testing.T) {
for _, c := range cases {
b := c.Batcher() | lfs/batcher: rename assertAll to runBatcherTests | git-lfs_git-lfs | train | go |
1fd54bf3d173d1d4a145a09421d97d8d62e5f6a1 | diff --git a/billing/integrations/pay_pal_integration.py b/billing/integrations/pay_pal_integration.py
index <HASH>..<HASH> 100644
--- a/billing/integrations/pay_pal_integration.py
+++ b/billing/integrations/pay_pal_integration.py
@@ -2,6 +2,8 @@ from billing import Integration
from django.conf import settings
from paypal.standard.conf import POSTBACK_ENDPOINT, SANDBOX_POSTBACK_ENDPOINT
from django.conf.urls.defaults import patterns, include
+from paypal.standard.ipn.signals import payment_was_flagged, payment_was_successful
+from billing.signals import transaction_was_successful, transaction_was_unsuccessful
class PayPalIntegration(Integration):
def __init__(self):
@@ -26,3 +28,16 @@ class PayPalIntegration(Integration):
(r'^', include('paypal.standard.ipn.urls')),
)
return urlpatterns
+
+def unsuccessful_txn_handler(sender, **kwargs):
+ transaction_was_unsuccesful.send(sender=sender.__class__,
+ type="purchase",
+ response=self)
+
+def successful_txn_handler(sender, **kwargs):
+ transaction_was_succesful.send(sender=sender.__class__,
+ type="purchase",
+ response=self)
+
+payment_was_flagged.connect(unsuccessful_txn_handler)
+payment_was_successful.connect(successful_txn_handler) | Added the transaction_was_successful and transaction_was_unsuccessful in the PayPal integration. Fixes #9. | agiliq_merchant | train | py |
174e8bd225124e26b92e677af07ebde5a4c77ca4 | diff --git a/pyipmi/sel.py b/pyipmi/sel.py
index <HASH>..<HASH> 100644
--- a/pyipmi/sel.py
+++ b/pyipmi/sel.py
@@ -134,8 +134,7 @@ class SelEntry(State):
string.append(' Sensor Number: %d' % self.sensor_number)
string.append(' Event Direction: %d' % self.event_direction)
string.append(' Event Type: 0x%02x' % self.event_type)
- string.append(' Event Data: %s' % array('B',
- self.event_data).tolist())
+ string.append(' Event Data: %s' % array('B', self.event_data).tolist())
return "\n".join(string)
@staticmethod | Unnecessary line-break removed | kontron_python-ipmi | train | py |
b46de08219d0c6d0a2a4febf98607ac67d344dcd | diff --git a/nion/instrumentation/test/HardwareSource_test.py b/nion/instrumentation/test/HardwareSource_test.py
index <HASH>..<HASH> 100644
--- a/nion/instrumentation/test/HardwareSource_test.py
+++ b/nion/instrumentation/test/HardwareSource_test.py
@@ -812,7 +812,7 @@ class TestHardwareSourceClass(unittest.TestCase):
document_model.append_data_item(data_item)
document_model.setup_channel(document_model.make_data_item_reference_key(hardware_source.hardware_source_id, "a"), data_item)
hardware_source.data_channels[0].update(DataAndMetadata.new_data_and_metadata(data), "complete", None, None, None, None)
- hardware_source.sleep = 0.10
+ hardware_source.sleep = 0.20
hardware_source.start_playing()
time.sleep(0.02)
hardware_source.abort_playing(sync_timeout=3.0) | Minor test adjustment to be more resilient. | nion-software_nionswift-instrumentation-kit | train | py |
6894d518603082c82bba8bdb2b83094712dd8730 | diff --git a/lib/dhis2/api/base.rb b/lib/dhis2/api/base.rb
index <HASH>..<HASH> 100644
--- a/lib/dhis2/api/base.rb
+++ b/lib/dhis2/api/base.rb
@@ -94,10 +94,12 @@ module Dhis2
def add_relation(relation, relation_id)
client.post("#{self.class.resource_name}/#{id}/#{relation}/#{relation_id}", attributes)
+ self
end
def remove_relation(relation, relation_id)
client.delete("#{self.class.resource_name}/#{id}/#{relation}/#{relation_id}", attributes)
+ self
end
def delete | Allow to add/remove from relationship. | BLSQ_dhis2 | train | rb |
b03de47691231167364909d39006d706f6bace03 | diff --git a/tests/unit/modules/test_tomcat.py b/tests/unit/modules/test_tomcat.py
index <HASH>..<HASH> 100644
--- a/tests/unit/modules/test_tomcat.py
+++ b/tests/unit/modules/test_tomcat.py
@@ -10,6 +10,7 @@ from tests.support.mock import MagicMock, patch
# Import salt module
import salt.modules.tomcat as tomcat
+from salt.ext.six import string_types
# Import 3rd-party libs
from io import StringIO, BytesIO
@@ -34,7 +35,7 @@ class TomcatTestCasse(TestCase, LoaderModuleMockMixin):
with patch('salt.modules.tomcat._urlopen', string_mock):
response = tomcat._wget('tomcat.wait', url='http://localhost:8080/nofail')
for line in response['msg']:
- self.assertTrue((isinstance(line, unicode) or isinstance(line, str)))
+ self.assertIsInstance(line, string_types)
with patch('salt.modules.tomcat._urlopen', bytes_mock):
try:
@@ -46,4 +47,4 @@ class TomcatTestCasse(TestCase, LoaderModuleMockMixin):
raise type_error
for line in response['msg']:
- self.assertTrue((isinstance(line, unicode) or isinstance(line, str)))
+ self.assertIsInstance(line, string_types) | Use six as backwards compatibility layer for string test | saltstack_salt | train | py |
b87b0a9279e68ca3d072ff7d0d767aad4f62ee20 | diff --git a/src/Html/Attributes.php b/src/Html/Attributes.php
index <HASH>..<HASH> 100644
--- a/src/Html/Attributes.php
+++ b/src/Html/Attributes.php
@@ -7,5 +7,6 @@ class Attributes implements AttributesInterface {
use AttributesTrait {
renderAttributes as public;
renderTag as public;
+ createTag as public;
}
} | Attributes: use AttributesTrait::createTag() as public. | donquixote_cellbrush | train | php |
f5118a586f27286d3027f222c2f2204738c0163a | diff --git a/restcomm/restcomm.mscontrol.mms/src/main/java/org/mobicents/servlet/restcomm/mscontrol/mgcp/MmsConferenceController.java b/restcomm/restcomm.mscontrol.mms/src/main/java/org/mobicents/servlet/restcomm/mscontrol/mgcp/MmsConferenceController.java
index <HASH>..<HASH> 100644
--- a/restcomm/restcomm.mscontrol.mms/src/main/java/org/mobicents/servlet/restcomm/mscontrol/mgcp/MmsConferenceController.java
+++ b/restcomm/restcomm.mscontrol.mms/src/main/java/org/mobicents/servlet/restcomm/mscontrol/mgcp/MmsConferenceController.java
@@ -535,6 +535,8 @@ public final class MmsConferenceController extends MediaServerController {
// Destroy Media Group
mediaGroup.tell(new StopMediaGroup(), super.source);
// Destroy Bridge Endpoint and its connections
+ here check if no slave is in mrb new table then go otherwise no
+ also check if this is last participant in whole conf then tell CMRC to destroy master conference ep.
cnfEndpoint.tell(new DestroyEndpoint(), super.source);
}
} | added hint #<I> for tomorrow | RestComm_Restcomm-Connect | train | java |
aef3252a9a9615d9fcd80af9398dadd3a1e06661 | diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -71,9 +71,9 @@ class Chef
description: "Specify whether to accept the EULA. Certain dmgs require acceptance of EULA before mounting.",
default: false, desired_state: false
- property :headers, [Hash, nil],
+ property :headers, Hash,
description: "Allows custom HTTP headers (like cookies) to be set on the remote_file resource.",
- default: nil, desired_state: false
+ desired_state: false
property :allow_untrusted, [TrueClass, FalseClass],
description: "Allow installation of packages that do not have trusted certificates.", | header property: Don't default to nil or accept nil
This is a old legacy leftover from LWRP-land | chef_chef | train | rb |
65b1818b37303b04bbd9d4940bb4c8ec728df897 | diff --git a/lib/scorpio/schema.rb b/lib/scorpio/schema.rb
index <HASH>..<HASH> 100644
--- a/lib/scorpio/schema.rb
+++ b/lib/scorpio/schema.rb
@@ -26,6 +26,19 @@ module Scorpio
end
end
+ def match_to_object(object)
+ object = object.content if object.is_a?(Scorpio::JSON::Node)
+ if schema_node && schema_node['oneOf']
+ matched = schema_node['oneOf'].map(&:deref).map do |oneof|
+ oneof_matched = self.class.new(oneof).match_to_object(object)
+ if oneof_matched.validate(object)
+ oneof_matched
+ end
+ end.compact.first
+ end
+ matched || self
+ end
+
def subschema_for_index(index)
if schema_node['items'].is_a?(Scorpio::JSON::ArrayNode)
if index < schema_node['items'].size | Scorpio::Schema#match_to_object to replace match_schema functionality removing from SchemaObjectBase module #[] | notEthan_jsi | train | rb |
e6eacfdb2e0dd1bf036020ceea132e77beb8c6ac | diff --git a/openprovider/modules/ssl.py b/openprovider/modules/ssl.py
index <HASH>..<HASH> 100644
--- a/openprovider/modules/ssl.py
+++ b/openprovider/modules/ssl.py
@@ -84,6 +84,12 @@ class SSLModule(common.Module):
))
return int(response.data.id)
+
+ def renew(self, order_id):
+ response = self.request(E.renewSslCertRequest(
+ E.id(order_id),
+ ))
+ return int(response.data.id)
def reissue(self, order_id, csr, software_id, organization_handle, approver_email=None,
signature_hash_algorithm=None, domain_validation_methods=None, hostnames=None, | added ssl renew api call | AntagonistHQ_openprovider.py | train | py |
072ab8b137826776c3b063f1a56a872ba668f093 | diff --git a/backtrader/feed.py b/backtrader/feed.py
index <HASH>..<HASH> 100644
--- a/backtrader/feed.py
+++ b/backtrader/feed.py
@@ -70,7 +70,9 @@ class MetaAbstractDataBase(dataseries.OHLCDateTime.__class__):
super(MetaAbstractDataBase, cls).dopostinit(_obj, *args, **kwargs)
# Either set by subclass or the parameter or use the dataname (ticker)
- _obj._name = _obj._name or _obj.p.name or _obj.p.dataname
+ _obj._name = _obj._name or _obj.p.name
+ if not _obj._name and isinstance(_obj.p.dataname, string_types):
+ _obj._name = _obj.p.dataname
_obj._compression = _obj.p.compression
_obj._timeframe = _obj.p.timeframe | Avoid assigning a non-string dataname to _name | backtrader_backtrader | train | py |
1078e38cb0349ec6f4f1ac1dc76f9ca1f5bd25ae | diff --git a/src/msearch/daten/DatenFilm.java b/src/msearch/daten/DatenFilm.java
index <HASH>..<HASH> 100644
--- a/src/msearch/daten/DatenFilm.java
+++ b/src/msearch/daten/DatenFilm.java
@@ -571,7 +571,8 @@ public class DatenFilm implements Comparable<DatenFilm> {
"+++ Aus rechtlichen Gründen ist dieses Video nur innerhalb von Deutschland verfügbar. +++",
"+++ Aus rechtlichen Gründen kann das Video nur innerhalb von Deutschland abgerufen werden. +++ Due to legal reasons the video is only available in Germany.+++",
"+++ Aus rechtlichen Gründen kann das Video nur innerhalb von Deutschland abgerufen werden. +++",
- "+++ Due to legal reasons the video is only available in Germany.+++"
+ "+++ Due to legal reasons the video is only available in Germany.+++",
+ "+++ Aus rechtlichen Gründen kann das Video nur in Deutschland abgerufen werden. +++"
};
public static String cleanDescription(String s, String thema, String titel) { | Added new copyright text message for description removal. | mediathekview_MLib | train | java |
f61293e456ac3f96acd0a1cbe679befce76a1127 | diff --git a/lib/deliver/deliver_process.rb b/lib/deliver/deliver_process.rb
index <HASH>..<HASH> 100644
--- a/lib/deliver/deliver_process.rb
+++ b/lib/deliver/deliver_process.rb
@@ -189,6 +189,7 @@ module Deliver
content = File.read(File.join(language_folder, "#{key}.txt")) rescue nil
next unless content
content = content.split("\n") if key == 'keywords'
+ content = content.strip if key == 'privacy_url' || key == 'software_url' || key == 'support_url'
@deploy_information[value] ||= {}
@deploy_information[value][language] ||= content | strip contents of file for URLs
Having a newline or something in the url files for metadata would cause
it to fail | fastlane_fastlane | train | rb |
3bdc56c194cea6a0f69be42c6648853ff6f0a081 | diff --git a/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java b/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
index <HASH>..<HASH> 100644
--- a/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
+++ b/flux-core/src/main/java/org/apache/storm/flux/FluxBuilder.java
@@ -161,6 +161,7 @@ public class FluxBuilder {
} else {
grouping = (CustomStreamGrouping) clazz.newInstance();
}
+ applyProperties(def, grouping, context);
return grouping;
}
@@ -324,6 +325,7 @@ public class FluxBuilder {
} else {
spout = (IRichSpout) clazz.newInstance();
}
+ applyProperties(def, spout, context);
return spout;
}
@@ -361,6 +363,7 @@ public class FluxBuilder {
bolt = clazz.newInstance();
}
context.addBolt(def.getId(), bolt);
+ applyProperties(def, bolt, context);
}
} | fix issue with properties not being applied to spouts, bolts, and custom stream groupings. | ptgoetz_flux | train | java |
c76d6dad30e87e7984c6b2e5a0f623763386a39f | diff --git a/nolds/measures.py b/nolds/measures.py
index <HASH>..<HASH> 100644
--- a/nolds/measures.py
+++ b/nolds/measures.py
@@ -1382,7 +1382,7 @@ def hurst_multifractal_dm(data, qvals=[1], max_dists=range(5, 20)):
])
hhcorr = np.array(hhcorr, dtype="float32")
H = np.array([
- _aste_line_fit(np.log(range(1, md)), np.log(hhcorr[:md-1, qi]))[1]
+ _aste_line_fit(np.log(range(1, md+1)), np.log(hhcorr[:md, qi]))[1]
for qi in range(len(qvals))
for md in max_dists
], dtype="float32").reshape(len(qvals), len(max_dists)) | bugfix: adjusts limits for line fit (start at 1, include upper limit) | CSchoel_nolds | train | py |
5b40fedad2375e4b4fa44f48a2428a50cc02a753 | diff --git a/lib/keyboard_reactor/output.rb b/lib/keyboard_reactor/output.rb
index <HASH>..<HASH> 100644
--- a/lib/keyboard_reactor/output.rb
+++ b/lib/keyboard_reactor/output.rb
@@ -25,7 +25,7 @@ module KeyboardReactor
end
def hex_file_path
- self.class.relative_path("#{firmware_path}/keymap_#{@id}")
+ self.class.relative_path("#{firmware_path}/#{@id}.hex")
end
def write_output(keyboard_json)
@@ -56,7 +56,8 @@ module KeyboardReactor
def write_hex_file
write_c_file
- `cd #{firmware_path.to_s} && make KEYMAP="#{id}"`
+ # Override the default target with our ID so that we create unique files
+ `cd #{firmware_path.to_s} && make clean && TARGET=#{id} make -e KEYMAP="#{id}"`
end
# post '/' do | Override TARGET, correct hex file location | zsa_reactor | train | rb |
20287074cdbc30ec177860e463b328e26d20fdc3 | diff --git a/store/root/list.go b/store/root/list.go
index <HASH>..<HASH> 100644
--- a/store/root/list.go
+++ b/store/root/list.go
@@ -25,10 +25,16 @@ func (r *Store) Tree() (tree.Tree, error) {
root := simple.New("gopass")
addFileFunc := func(in ...string) {
for _, f := range in {
- ct := "text/plain"
- if strings.HasSuffix(f, ".b64") {
+ var ct string
+ switch {
+ case strings.HasSuffix(f, ".b64"):
ct = "application/octet-stream"
- f = strings.TrimSuffix(f, ".b64")
+ case strings.HasSuffix(f, ".yml"):
+ ct = "text/yaml"
+ case strings.HasSuffix(f, ".yaml"):
+ ct = "text/yaml"
+ default:
+ ct = "text/plain"
}
if err := root.AddFile(f, ct); err != nil {
fmt.Printf("Failed to add file %s to tree: %s\n", f, err) | Display full secrets paths for all content types (#<I>)
Fixes #<I> | gopasspw_gopass | train | go |
a6abc48c2ea39988f15ef6745e4f69fcde3c9e1c | diff --git a/app/views/dashboard/incidents.blade.php b/app/views/dashboard/incidents.blade.php
index <HASH>..<HASH> 100644
--- a/app/views/dashboard/incidents.blade.php
+++ b/app/views/dashboard/incidents.blade.php
@@ -16,7 +16,7 @@
@if ($incidents->count() === 0)
<div class="list-group-item">Woah! No incidents, your doing well!</div>
@else
- <p>You have <strong>{{ $incidents->count() }}</strong> incidents.</p>
+ <p class='lead'>You have <strong>{{ $incidents->count() }}</strong> logged incidents.</p>
@endif
<div class="striped-list"> | Use .lead for first p tag | CachetHQ_Cachet | train | php |
04f9ec43ef810f84870b1bb72e005aab85b1bf58 | diff --git a/src/screenfull.js b/src/screenfull.js
index <HASH>..<HASH> 100644
--- a/src/screenfull.js
+++ b/src/screenfull.js
@@ -90,7 +90,7 @@
if (/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)) {
elem[request]();
} else {
- elem[request](keyboardAllowed && Element.ALLOW_KEYBOARD_INPUT);
+ elem[request](keyboardAllowed ? Element.ALLOW_KEYBOARD_INPUT : {});
}
},
exit: function () { | Fix issue with Chrome <I>+ (#<I>) | sindresorhus_screenfull.js | train | js |
4794e5036f598841a73c67f49ec0e0c050e841da | diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
+++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
@@ -270,6 +270,8 @@ public class GermanSpellerRule extends CompoundAwareHunspellRule {
String suggestion;
if ("WIFI".equals(word) || "wifi".equals(word)) {
return Collections.singletonList("Wi-Fi");
+ } else if ("genomen".equals(word)) {
+ return Collections.singletonList("genommen");
} else if ("ausversehen".equals(word)) {
return Collections.singletonList("aus Versehen");
} else if ("getz".equals(word)) { | [de] suggestion for 'genomen' | languagetool-org_languagetool | train | java |
40f7e8035aeadc350efc7d062c3747daf6064eef | diff --git a/future/__init__.py b/future/__init__.py
index <HASH>..<HASH> 100644
--- a/future/__init__.py
+++ b/future/__init__.py
@@ -172,7 +172,7 @@ else:
__ver_major__ = 0
__ver_minor__ = 3
-__ver_patch__ = 4
+__ver_patch__ = 5
__ver_sub__ = ''
__version__ = "%d.%d.%d%s" % (__ver_major__,__ver_minor__,__ver_patch__,__ver_sub__)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,8 +24,7 @@ PACKAGES = ["future",
"future.backports.test",
"libfuturize",
"libfuturize.fixes2",
- "libfuturize.fixes3",
- "libfuturize.tests"]
+ "libfuturize.fixes3"]
PACKAGE_DATA = {'': [
'README.rst',
'LICENSE', | Remove empty directory libfuturize.tests from setup.py packages list
Otherwise "python setup.py build" bails with this message:
error: package directory 'libfuturize/tests' does not exist | PythonCharmers_python-future | train | py,py |
9a1356fbe6f32221143c87d2efb5f8119cd2e5c8 | diff --git a/src/includes/classes/Core/Utils/WsVersion.php b/src/includes/classes/Core/Utils/WsVersion.php
index <HASH>..<HASH> 100644
--- a/src/includes/classes/Core/Utils/WsVersion.php
+++ b/src/includes/classes/Core/Utils/WsVersion.php
@@ -110,6 +110,12 @@ class WsVersion extends Classes\Core\Base\Core implements Interfaces\WsVersionCo
$m = substr($version, 2, 2); // Month.
$d = substr($version, 4, 2); // Day.
- return strtotime($Y.'-'.$m.'-'.$d);
+ $time = strtotime($Y.'-'.$m.'-'.$d.' 12:00 am');
+
+ if (preg_match('/^[0-9]{6}\.([0-9]+)/u', $version, $_m)) {
+ $time += $_m[1]; // Seconds into current day.
+ } // unset($_m); // Housekeeping.
+
+ return $time;
}
} | Adding `.[time]` to version-to-date converter. | wpsharks_core | train | php |
9b8805af8caf9d9c83341f838177e843dcfdc165 | diff --git a/fabrik/recipes/django.py b/fabrik/recipes/django.py
index <HASH>..<HASH> 100644
--- a/fabrik/recipes/django.py
+++ b/fabrik/recipes/django.py
@@ -36,10 +36,7 @@ def after_deploy():
_migrate()
# Handle invalid collectstatic gracefully
- try:
- _collectstatic()
- except Exception as e: # NOQA
- pass
+ _collectstatic()
if "public_path" in env:
paths.symlink(paths.get_current_path(), env.public_path)
@@ -52,7 +49,7 @@ def _migrate():
def _collectstatic():
with(env.cd(paths.get_current_path())):
- env.run("python manage.py collectstatic --noinput")
+ env.run("python manage.py collectstatic --noinput", warn_only=True)
@hook("rollback") | Fixed issue with collecstatic failing | Frojd_Fabrik | train | py |
0835f1c74f42a4f2285fb198614a441697e0281d | diff --git a/tests/scripts/unit/wee-dom.js b/tests/scripts/unit/wee-dom.js
index <HASH>..<HASH> 100644
--- a/tests/scripts/unit/wee-dom.js
+++ b/tests/scripts/unit/wee-dom.js
@@ -920,12 +920,14 @@ describe('DOM', () => {
expect($('.child').length).to.equal(4);
expect($('.child')[3].innerHTML).to.equal('3');
+ expect($('.child')[3].parentNode.className).to.equal('parent');
});
it('should prepend selection to end of parent target', () => {
$('.parent').prepend($('#first'));
expect($('div', '.parent')[3].innerHTML).to.equal('3');
+ expect($('#first')[0].parentNode.className).to.equal('parent');
});
it('should execute callback and append return value', () => { | Add additional assertions for $prepend method | weepower_wee-core | train | js |
62df53be80fdecf6c48b4913ed25e367e8419a07 | diff --git a/Connection.php b/Connection.php
index <HASH>..<HASH> 100755
--- a/Connection.php
+++ b/Connection.php
@@ -5,7 +5,6 @@ namespace Illuminate\Database;
use PDO;
use Closure;
use Exception;
-use Throwable;
use LogicException;
use DateTimeInterface;
use Illuminate\Support\Arr;
@@ -479,7 +478,7 @@ class Connection implements ConnectionInterface
*/
public function pretend(Closure $callback)
{
- return $this->withFreshQueryLog(function() use ($callback) {
+ return $this->withFreshQueryLog(function () use ($callback) {
$this->pretending = true;
// Basically to make the database connection "pretend", we will just return
@@ -783,7 +782,6 @@ class Connection implements ConnectionInterface
if (isset($this->events)) {
$this->events->fire($event);
}
-
}
/** | Apply fixes from StyleCI (#<I>) | illuminate_database | train | php |
9feda9abf20a624fb4b6e275fa167c45ff163f3b | diff --git a/lib/vagrant-mutate/converter/kvm.rb b/lib/vagrant-mutate/converter/kvm.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant-mutate/converter/kvm.rb
+++ b/lib/vagrant-mutate/converter/kvm.rb
@@ -17,7 +17,12 @@ module VagrantMutate
uuid = nil
gui = true
- disk_bus = @input_box.disk_interface
+
+ if @force_virtio == true
+ disk_bus = 'virtio'
+ else
+ disk_bus = @input_box.disk_interface
+ end
image_type = @output_box.image_format
disk = @output_box.image_name | Add force virtio support to kvm | sciurus_vagrant-mutate | train | rb |
c3cee0713ac02f5706132f4278c4bca547358c65 | diff --git a/examples/node/xds/greeter_client.js b/examples/node/xds/greeter_client.js
index <HASH>..<HASH> 100644
--- a/examples/node/xds/greeter_client.js
+++ b/examples/node/xds/greeter_client.js
@@ -53,7 +53,9 @@ function main() {
user = 'world';
}
client.sayHello({name: user}, function(err, response) {
+ if (err) throw err;
console.log('Greeting:', response.message);
+ client.close();
});
} | Node xDS example: show error on failure, close client when done | grpc_grpc | train | js |
c3b6af37056388ec67a6ef0b37625c0d0509d062 | diff --git a/hca/dss/__init__.py b/hca/dss/__init__.py
index <HASH>..<HASH> 100644
--- a/hca/dss/__init__.py
+++ b/hca/dss/__init__.py
@@ -225,9 +225,11 @@ class DSSClient(SwaggerClient):
:param float min_delay_seconds: The minimum number of seconds to wait in between retries.
Download a bundle and save it to the local filesystem as a directory.
- By default, all data and metadata files are downloaded. To disable the downloading of data files,
- use `--data-files ''` if using the CLI (or `data_files=()` if invoking `download` programmatically).
- Likewise for metadata files.
+
+ By default, all data and metadata files are downloaded. To disable the downloading of data, use the
+ `--no-data` flag if using the CLI or pass the `no_data=True` argument if calling the `download()` API method.
+ Likewise, to disable the downloading of metadata, use the `--no-metadata` flag for the CLI or pass the
+ `no_metadata=True` argument if calling the `download()` API method.
If a retryable exception occurs, we wait a bit and retry again. The delay increases each time we fail and
decreases each time we successfully read a block. We set a quota for the number of failures that goes up with | Fix dss download docstring to use correct flags (#<I>) | HumanCellAtlas_dcp-cli | train | py |
27ed48f3e645ee0729cce2f7949d87d864e8ccb2 | diff --git a/lib/oneview-sdk/image-streamer/resource/api300/plan_scripts.rb b/lib/oneview-sdk/image-streamer/resource/api300/plan_scripts.rb
index <HASH>..<HASH> 100644
--- a/lib/oneview-sdk/image-streamer/resource/api300/plan_scripts.rb
+++ b/lib/oneview-sdk/image-streamer/resource/api300/plan_scripts.rb
@@ -31,17 +31,9 @@ module OneviewSDK
# Retrieves the modified contents of the selected Plan Script as per the selected attributes.
# @return The script differences of the selected Plan Script
def retrieve_differences
- response = @client.rest_post("#{BASE_URI}/differences/#{extract_id_from_uri}")
+ response = @client.rest_post("#{BASE_URI}/differences/#{@data['uri'].split('/').last}")
@client.response_handler(response)
end
-
- private
-
- # Extracts the id of the uri.
- # @return The id of the plan script
- def extract_id_from_uri
- @data['uri'].split('/').last
- end
end
end
end | Adjusting the extraction of the id from uri | HewlettPackard_oneview-sdk-ruby | train | rb |
e8946825729da039e3252017214f258203fc4a36 | diff --git a/telemetry/telemetry/desktop_browser_backend.py b/telemetry/telemetry/desktop_browser_backend.py
index <HASH>..<HASH> 100644
--- a/telemetry/telemetry/desktop_browser_backend.py
+++ b/telemetry/telemetry/desktop_browser_backend.py
@@ -98,8 +98,8 @@ class DesktopBrowserBackend(browser_backend.BrowserBackend):
return DoNothingForwarder(ports[0])
class DoNothingForwarder(object):
- def __init__(self, host_port):
- self._host_port = host_port
+ def __init__(self, *port_pairs):
+ self._host_port = port_pairs[0][0]
@property
def url(self): | Fix Telemetry after r<I> / r<I>.
DoNothingForwarder needs the same fix as applied in r<I>.
BUG=
TEST=./tools/telemetry/run_tests --browser=system testConsole
Review URL: <URL> | catapult-project_catapult | train | py |
04c807a39c963657d9ec5e88d06c455636b984d8 | diff --git a/cmd/route-emitter/main.go b/cmd/route-emitter/main.go
index <HASH>..<HASH> 100644
--- a/cmd/route-emitter/main.go
+++ b/cmd/route-emitter/main.go
@@ -8,11 +8,11 @@ import (
"time"
"code.cloudfoundry.org/bbs"
+ "code.cloudfoundry.org/cfhttp"
"code.cloudfoundry.org/cflager"
"code.cloudfoundry.org/consuladapter"
"code.cloudfoundry.org/debugserver"
"code.cloudfoundry.org/locket"
- "github.com/cloudfoundry-incubator/cf_http"
route_emitter "github.com/cloudfoundry-incubator/route-emitter"
"github.com/cloudfoundry-incubator/route-emitter/nats_emitter"
"github.com/cloudfoundry-incubator/route-emitter/routing_table"
@@ -140,7 +140,7 @@ func main() {
cflager.AddFlags(flag.CommandLine)
flag.Parse()
- cf_http.Initialize(*communicationTimeout)
+ cfhttp.Initialize(*communicationTimeout)
logger, reconfigurableSink := cflager.New(*sessionName)
natsClient := diegonats.NewClient() | Update and rename cf_http -> cfhttp
[#<I>] | cloudfoundry_route-emitter | train | go |
968caee6472019c9487e13ca31ef5abada54518e | diff --git a/gcsweb/cmd/gcsweb/gcsweb.go b/gcsweb/cmd/gcsweb/gcsweb.go
index <HASH>..<HASH> 100644
--- a/gcsweb/cmd/gcsweb/gcsweb.go
+++ b/gcsweb/cmd/gcsweb/gcsweb.go
@@ -303,8 +303,12 @@ func (s *server) handleObject(w http.ResponseWriter, bucket, object string, head
}
defer objReader.Close()
- if headers.contentType != "" && headers.contentEncoding != "" {
- w.Header().Set("Content-Type", fmt.Sprintf("%s; charset=%s", headers.contentType, headers.contentEncoding))
+ if headers.contentType != "" {
+ if headers.contentEncoding != "" {
+ w.Header().Set("Content-Type", fmt.Sprintf("%s; charset=%s", headers.contentType, headers.contentEncoding))
+ } else {
+ w.Header().Set("Content-Type", headers.contentType)
+ }
}
if headers.contentDisposition != "" { | add a content-type header even when encoding is missing | kubernetes_test-infra | train | go |
55184e917f01e1c02822d806fdd81c53388e18df | diff --git a/bin/now-deploy.js b/bin/now-deploy.js
index <HASH>..<HASH> 100755
--- a/bin/now-deploy.js
+++ b/bin/now-deploy.js
@@ -582,7 +582,7 @@ async function sync({ token, config: { currentTeam, user } }) {
)
}
const size = bytes(now.syncAmount)
- const syncCount = `${now.syncFileCount} file${now.syncFileCount > 1 && 's'}`
+ const syncCount = `${now.syncFileCount} file${now.syncFileCount > 1 ? 's' : ''}`
const bar = new Progress(
`> Upload [:bar] :percent :etas (${size}) [${syncCount}]`,
{ | Fix file count with 1 file (#<I>) | zeit_now-cli | train | js |
b780d92d62ce3152d687d5684c5acbf04760089e | diff --git a/tests/test_namespace.py b/tests/test_namespace.py
index <HASH>..<HASH> 100644
--- a/tests/test_namespace.py
+++ b/tests/test_namespace.py
@@ -1,4 +1,5 @@
-from collections import Mapping
+from collections.abc import Mapping
+from unittest.mock import patch
import pytest
@@ -46,6 +47,20 @@ def test_not_configured():
assert str(subject.does_nope_exist) == repr(subject.does.nope.exist)
+def test_collisions():
+ with patch('confidence.warnings') as warnings:
+ subject = Configuration({'key': 'value', 'keys': [1, 2], '_separator': '_'})
+
+ for collision in ('keys', '_separator'):
+ warnings.warn.assert_any_call('key {key} collides with member of Configuration type, use get() method to '
+ 'retrieve key {key}'.format(key=collision),
+ UserWarning)
+
+ assert subject.key == 'value'
+ assert callable(subject.keys)
+ assert subject._separator == '.'
+
+
def test_dir():
subject = Configuration({'key1': 'value', 'key2': 5, 'namespace.key3': False}) | Test key / member collisions during initialization | HolmesNL_confidence | train | py |
5fe81d85c4a14c3bf51f64415f18cb497556a32c | diff --git a/code/libraries/koowa/components/com_activities/model/entity/activity.php b/code/libraries/koowa/components/com_activities/model/entity/activity.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_activities/model/entity/activity.php
+++ b/code/libraries/koowa/components/com_activities/model/entity/activity.php
@@ -482,7 +482,18 @@ class ComActivitiesModelEntityActivity extends KModelEntityRow implements KObjec
/**
* Get an activity object
*
- * @param array $config An optional configuration array.
+ * @param array $config An optional configuration array. The configuration array may contain
+ * activity object data as defined by ComActivitiesActivityObjectInterface. Additionally the
+ * following parameters may be passed in the configuration array:
+ *
+ * - find (string): the label of an object to look for. If not found the object being created
+ * is set as deleted (with its deleted property set to true) and non-linkable (with its url
+ * property set to null). A call to a _findObjectLabel method will be attempted for determining if an
+ * object with label as defined by Label exists.
+ *
+ * - translate (array): a list of property names to be translated. By default all properties containing
+ * the display prefix are set as translatables.
+ *
* @return ComActivitiesActivityObject The activity object.
*/
protected function _getObject($config = array()) | re #<I> Improved docblock
Documented the contents of the configuration array passed to the object getter method. | joomlatools_joomlatools-framework | train | php |
46882d383882f164da59d1a15eb5749f1687e1e9 | diff --git a/lib/generators/instance/templates/instance_environment.rb b/lib/generators/instance/templates/instance_environment.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/instance/templates/instance_environment.rb
+++ b/lib/generators/instance/templates/instance_environment.rb
@@ -88,11 +88,11 @@ Radiant::Initializer.run do |config|
# standard extensions
config.gem "radiant-archive-extension", :version => "~> 1.0.0"
config.gem "radiant-clipped-extension", :version => "~> 1.0.0"
- config.gem "radiant-debug-extension", :version => "~> 1.0.0"
+ # config.gem "radiant-debug-extension", :version => "~> 1.0.0"
config.gem "radiant-exporter-extension", :version => "~> 1.0.0"
config.gem "radiant-markdown_filter-extension", :version => "~> 1.0.0"
config.gem "radiant-sheets-extension", :version => "~> 1.0.0.pre"
- config.gem "radiant-site_templates-extension", :version => "~> 1.0.0"
+ # config.gem "radiant-site_templates-extension", :version => "~> 1.0.0"
config.gem "radiant-smarty_pants_filter-extension", :version => "~> 1.0.0"
config.gem "radiant-textile_filter-extension", :version => "~> 1.0.0" | disbale the debug and site_templates extensions by default | radiant_radiant | train | rb |
092e881be01ee1947a9c38530f08e6daaaeab5e7 | diff --git a/src/main/java/me/alb_i986/selenium/tinafw/domain/WebUser.java b/src/main/java/me/alb_i986/selenium/tinafw/domain/WebUser.java
index <HASH>..<HASH> 100644
--- a/src/main/java/me/alb_i986/selenium/tinafw/domain/WebUser.java
+++ b/src/main/java/me/alb_i986/selenium/tinafw/domain/WebUser.java
@@ -219,14 +219,14 @@ public class WebUser<T extends WebUser> {
public boolean equals(Object o) {
if(!(o instanceof WebUser))
return false;
- return equals((WebUser)o);
+ return equals((WebUser) o);
}
/**
* @param user
* @return true if the two users have the same username
*/
- public boolean equals(T user) {
+ public boolean equals(WebUser user) {
if(username == null || user == null)
return false;
return username.equals(user.getUsername()); | fix WebUser#equals
Previously, it could loop on #equals(Object). | alb-i986_selenium-tinafw | train | java |
c698575a858d30df206b629c596b02c348030634 | diff --git a/media/boom/js/boom.chunk.js b/media/boom/js/boom.chunk.js
index <HASH>..<HASH> 100755
--- a/media/boom/js/boom.chunk.js
+++ b/media/boom/js/boom.chunk.js
@@ -284,7 +284,7 @@ $.widget('ui.chunkLinkset', $.ui.chunk, {
});
this.dialog = $.boom.dialog.open({
- url: this.options.urlPrefix + '/linkset/' + $.boom.page.config.id,
+ url: this.options.urlPrefix + '/linkset/edit/' + $.boom.page.config.id,
title: 'Edit linkset',
id: self.element[0].id + '-boom-dialog',
width: 400,
@@ -473,9 +473,9 @@ $.widget('ui.chunkLinkset', $.ui.chunk, {
var link = {
- name: $(this).text(),
- uri: url,
- target_page_rid: $(this).attr('rel'),
+ title: $(this).text(),
+ url: url,
+ target_page_id: $(this).attr('rel'),
sequence: sequence
}; | Changed names of linkset links properties in _getData() | boomcms_boom-core | train | js |
51e55ba772abf48a96be7541551348b9e8132029 | diff --git a/app/src/Bolt/DataCollector/TwigDataCollector.php b/app/src/Bolt/DataCollector/TwigDataCollector.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/DataCollector/TwigDataCollector.php
+++ b/app/src/Bolt/DataCollector/TwigDataCollector.php
@@ -168,7 +168,6 @@ class TwigDataCollector extends DataCollector
return $this->data['templatechosen'];
}
-
/**
* Getter for templateerror
* | PSR-2 clean up of DataCollector/TwigDataCollector.php | bolt_bolt | train | php |
9e86a31caeabd15639981accb9c515f2e47eda74 | diff --git a/astrocats/catalog/spectrum.py b/astrocats/catalog/spectrum.py
index <HASH>..<HASH> 100644
--- a/astrocats/catalog/spectrum.py
+++ b/astrocats/catalog/spectrum.py
@@ -20,6 +20,7 @@ class SPECTRUM(KeyCollection):
SNR = Key('snr', KEY_TYPES.NUMERIC, compare=False)
TIME = Key('time', KEY_TYPES.NUMERIC, compare=False, listable=True)
REDSHIFT = Key('redshift', KEY_TYPES.NUMERIC, compare=False)
+ AIRMASS = Key('airmass', KEY_TYPES.NUMERIC, compare=False)
FILENAME = Key('filename', KEY_TYPES.STRING)
U_FLUXES = Key('u_fluxes', KEY_TYPES.STRING, compare=False) | ENH: added `AIRMASS` key to `SPECTRUM` | astrocatalogs_astrocats | train | py |
9584ecc6eca1d0d3dc27aa497452d2f3612594eb | diff --git a/tests/Doctrine/Tests/Common/DataFixtures/DependentFixtureTest.php b/tests/Doctrine/Tests/Common/DataFixtures/DependentFixtureTest.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/Tests/Common/DataFixtures/DependentFixtureTest.php
+++ b/tests/Doctrine/Tests/Common/DataFixtures/DependentFixtureTest.php
@@ -154,6 +154,21 @@ class DependentFixtureTest extends BaseTest
$orderedFixtures = $loader->getFixtures();
}
+
+ public function test_inCaseGetFixturesReturnsDifferentResultsEachTime()
+ {
+ $loader = new Loader();
+ $loader->addFixture(new DependentFixture1);
+ $loader->addFixture(new BaseParentFixture1);
+
+ // Intentionally calling getFixtures() twice
+ $loader->getFixtures();
+ $orderedFixtures = $loader->getFixtures();
+
+ $this->assertCount(2, $orderedFixtures);
+ $this->assertInstanceOf(__NAMESPACE__ . '\BaseParentFixture1', array_shift($orderedFixtures));
+ $this->assertInstanceOf(__NAMESPACE__ . '\DependentFixture1', array_shift($orderedFixtures));
+ }
}
class DependentFixture1 implements FixtureInterface, DependentFixtureInterface | New test for calling Loader's getFixtures() method when using dependent fixtures. | doctrine_data-fixtures | train | php |
4927879eae3728e559c91f552d29f681bb73b54c | diff --git a/openpnm/models/physics/__init__.py b/openpnm/models/physics/__init__.py
index <HASH>..<HASH> 100644
--- a/openpnm/models/physics/__init__.py
+++ b/openpnm/models/physics/__init__.py
@@ -18,3 +18,5 @@ from . import thermal_conductance
from . import hydraulic_conductance
from . import multiphase
from . import generic_source_term
+from . import flow_shape_factors
+from . import poisson_shape_factors
\ No newline at end of file | Modified physics models init file | PMEAL_OpenPNM | train | py |
6e6aed6a744a16b3598a8962afde0bbc4f32aa71 | diff --git a/poetry/packages/locker.py b/poetry/packages/locker.py
index <HASH>..<HASH> 100644
--- a/poetry/packages/locker.py
+++ b/poetry/packages/locker.py
@@ -152,7 +152,7 @@ class Locker:
def _get_content_hash(self): # type: () -> str
"""
- Returns the sha256 hash of the sorted content of the composer file.
+ Returns the sha256 hash of the sorted content of the pyproject file.
"""
content = self._local_config | Fix typo in comment (#<I>) | sdispater_poetry | train | py |
ba272e377df5267591f4a8a600897be69ae181ea | diff --git a/src/aws/TagActiveWindow.php b/src/aws/TagActiveWindow.php
index <HASH>..<HASH> 100644
--- a/src/aws/TagActiveWindow.php
+++ b/src/aws/TagActiveWindow.php
@@ -54,7 +54,7 @@ class TagActiveWindow extends ActiveWindow
/**
* Getter tableName.
*
- * @return unknown|string
+ * @return string
*/
public function getTableName()
{
@@ -68,7 +68,7 @@ class TagActiveWindow extends ActiveWindow
/**
* Setter tableName.
*
- * @param unknown $tableName
+ * @param string $tableName
*/
public function setTableName($tableName)
{ | Update TagActiveWindow.php | luyadev_luya-module-admin | train | php |
53372c5704870de11400761f840e96779bed4c48 | diff --git a/test/unit/blocks.js b/test/unit/blocks.js
index <HASH>..<HASH> 100644
--- a/test/unit/blocks.js
+++ b/test/unit/blocks.js
@@ -1,5 +1,5 @@
var test = require('tap').test;
-var Blocks = require('../../src/engine/Blocks');
+var Blocks = require('../../src/engine/blocks');
test('spec', function (t) {
var b = new Blocks(); | Fixing case problem with blocks.js tests | LLK_scratch-vm | train | js |
c00a374a663e7cabc46f3bcf821ad7e6b97aa8e3 | diff --git a/src/main/java/org/spout/nbt/CompoundTag.java b/src/main/java/org/spout/nbt/CompoundTag.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/spout/nbt/CompoundTag.java
+++ b/src/main/java/org/spout/nbt/CompoundTag.java
@@ -29,7 +29,7 @@ package org.spout.nbt;
/**
* The {@code TAG_Compound} tag.
*/
-public final class CompoundTag extends Tag<CompoundMap> {
+public class CompoundTag extends Tag<CompoundMap> {
/**
* The value.
*/
diff --git a/src/main/java/org/spout/nbt/ListTag.java b/src/main/java/org/spout/nbt/ListTag.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/spout/nbt/ListTag.java
+++ b/src/main/java/org/spout/nbt/ListTag.java
@@ -33,7 +33,7 @@ import java.util.List;
/**
* The {@code TAG_List} tag.
*/
-public final class ListTag<T extends Tag<?>> extends Tag<List<T>> {
+public class ListTag<T extends Tag<?>> extends Tag<List<T>> {
/**
* The type of entries within this list.
*/ | Removed final from Compound and List tags | flow_nbt | train | java,java |
a77ab7ce7bc948ea6b4d51d507b519f1407240d2 | diff --git a/test/PngQuant.js b/test/PngQuant.js
index <HASH>..<HASH> 100644
--- a/test/PngQuant.js
+++ b/test/PngQuant.js
@@ -25,9 +25,9 @@ describe('PngQuant', () => {
'when piped through',
new PngQuant([128, '--quality', '60-80', '--nofs']),
'to yield output satisfying',
- resultPngBuffer => {
+ expect.it(resultPngBuffer => {
expect(resultPngBuffer.length, 'to be within', 0, 8285);
- }
+ })
));
it.skipIf( | Wrap to satisfy function in expect.it | papandreou_node-pngquant | train | js |
a275613d16a016b669750a164083c6b8133e3e0e | diff --git a/test/recipe/RemoteServerTest.php b/test/recipe/RemoteServerTest.php
index <HASH>..<HASH> 100644
--- a/test/recipe/RemoteServerTest.php
+++ b/test/recipe/RemoteServerTest.php
@@ -9,7 +9,7 @@ use \Deployer\Helper\RecipeTester;
class RemoteServerTest extends RecipeTester
{
- const IP_REG_EXP = '#^::1#';
+ const IP_REG_EXP = '#^(::1)|(127.0.0.1)$#';
/**
* @var \Deployer\Type\Result | Fixed Travis CI build fails follow @MaartenStaa suggestion | deployphp_deployer | train | php |
fde22f0404861630fd9dbff2ee01cbd6d9eff768 | diff --git a/src/utils/emitter.js b/src/utils/emitter.js
index <HASH>..<HASH> 100644
--- a/src/utils/emitter.js
+++ b/src/utils/emitter.js
@@ -101,7 +101,15 @@ const setter = function(target, key, descriptor) {
return
}
- const changed = { type: key, from: prev, to: val }
+ const from = prev && isFunction(prev.toObject)
+ ? prev.toObject()
+ : prev
+
+ const to = val && isFunction(val.toObject)
+ ? val.toObject()
+ : val
+
+ const changed = { type: key, from, to }
let current
try { | Convert from and to changes to object if possible | spirit_spirit | train | js |
45e64fc0c9139a410475f48f5c25b1c189147f11 | diff --git a/core/src/main/java/com/twitter/elephantbird/thrift/ThriftBinaryDeserializer.java b/core/src/main/java/com/twitter/elephantbird/thrift/ThriftBinaryDeserializer.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/twitter/elephantbird/thrift/ThriftBinaryDeserializer.java
+++ b/core/src/main/java/com/twitter/elephantbird/thrift/ThriftBinaryDeserializer.java
@@ -47,4 +47,7 @@ public class ThriftBinaryDeserializer extends TDeserializer {
protocol.setReadLength(bytes.length); // the class exists to do this
super.deserialize(base, bytes);
}
+
+ // TODO: should add deserialize(TBase, bytes, offset, length).
+ // it could avoid a copy in many cases.
} | add to TODO for buffer copy friendly deserialize(). | twitter_elephant-bird | train | java |
14682461e12b796842fd1580e8507c196821f44f | diff --git a/src/js/libpannellum.js b/src/js/libpannellum.js
index <HASH>..<HASH> 100644
--- a/src/js/libpannellum.js
+++ b/src/js/libpannellum.js
@@ -985,8 +985,8 @@ function Renderer(container) {
this.image = new Image();
this.image.addEventListener('load', function() {
processLoadedTexture(self.image, self.texture);
- releaseTextureImageLoader(self);
self.callback(self.texture);
+ releaseTextureImageLoader(self);
});
}; | Fix multires texture loading artifacts (regression introduced in <I>c6cf<I>f7eb7c1accf<I>ab5fd2e<I>d<I>c<I>). | mpetroff_pannellum | train | js |
98f3e6729f5e889990cc8a72341df5b0df889511 | diff --git a/lib/flapjack/cli/notifier.rb b/lib/flapjack/cli/notifier.rb
index <HASH>..<HASH> 100644
--- a/lib/flapjack/cli/notifier.rb
+++ b/lib/flapjack/cli/notifier.rb
@@ -158,6 +158,7 @@ module Flapjack
if File.exists?(filename + '.rb')
@log.debug("Loading the #{notifier.to_s.capitalize} notifier")
require filename
+ config.merge!(:logger => @log)
@notifiers << Flapjack::Notifiers.const_get("#{notifier.to_s.capitalize}").new(config)
else
@log.warning("Flapjack::Notifiers::#{notifier.to_s.capitalize} doesn't exist!") | pass in a logger when setting up a notifier | flapjack_flapjack | train | rb |
00e560fc7bc1b3a6d40d18244bd3a3148bf853d6 | diff --git a/werkzeug/contrib/fixers.py b/werkzeug/contrib/fixers.py
index <HASH>..<HASH> 100644
--- a/werkzeug/contrib/fixers.py
+++ b/werkzeug/contrib/fixers.py
@@ -102,8 +102,8 @@ class ProxyFix(object):
forwarded_host = getter('HTTP_X_FORWARDED_HOST', '')
environ.update({
'werkzeug.proxy_fix.orig_wsgi_url_scheme': getter('wsgi.url_scheme'),
- 'werkzeug.proxy_fix.orig_remote_addr': getter('REMOTE_ADDR'),
- 'werkzeug.proxy_fix.orig_http_host': getter('HTTP_HOST')
+ 'werkzeug.proxy_fix.orig_remote_addr': getter('REMOTE_ADDR'),
+ 'werkzeug.proxy_fix.orig_http_host': getter('HTTP_HOST')
})
if forwarded_for:
environ['REMOTE_ADDR'] = forwarded_for[0].strip() | Small reindent in the fixers | pallets_werkzeug | train | py |
9d5e95518e0ec757cd5c4b83f27ff872d217e24e | diff --git a/packages/bonde-styleguide/src/cards/Card/Card.js b/packages/bonde-styleguide/src/cards/Card/Card.js
index <HASH>..<HASH> 100644
--- a/packages/bonde-styleguide/src/cards/Card/Card.js
+++ b/packages/bonde-styleguide/src/cards/Card/Card.js
@@ -33,6 +33,10 @@ const CardTitle = ({ children }) => (
</Text>
)
+const NoTitle = styled.div`
+ height: 46px;
+`
+
/**
* The only true card.
*/
@@ -43,7 +47,10 @@ const Card = styled(({
...boxProps
}) => (
<div className={className}>
- {title && (<CardTitle>{title}</CardTitle>)}
+ {!title ?
+ <NoTitle /> :
+ <CardTitle>{title}</CardTitle>
+ }
<CardBox {...boxProps}>
{children}
</CardBox> | fix(styleguide): keep the space of card title | nossas_bonde-client | train | js |
257e684be673a9af7fe69a2a89ee20d387d9560a | diff --git a/bind.go b/bind.go
index <HASH>..<HASH> 100644
--- a/bind.go
+++ b/bind.go
@@ -110,6 +110,9 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {
meta := make([]argMeta, len(args))
for i, arg := range args {
+ if a, ok := arg.(driver.Valuer); ok {
+ arg, _ = a.Value()
+ }
v := reflect.ValueOf(arg)
t := reflectx.Deref(v.Type()) | Valuer objects are evaluated before In expansion
Value() method of Valuer objects may change slices into non-slice objects or vice-versa.
Therefore we must do the evaluation before the expansion. | jmoiron_sqlx | train | go |
ce7a4bd9473c2e7368836c09ea476cacbba863cb | diff --git a/www/src/components/ComponentApi.js b/www/src/components/ComponentApi.js
index <HASH>..<HASH> 100644
--- a/www/src/components/ComponentApi.js
+++ b/www/src/components/ComponentApi.js
@@ -37,6 +37,7 @@ function ComponentApi({ heading, metadata, exportedBy }) {
<ImportApi name={importName} />
{/* use composes here */}
+ {/* eslint-disable-next-line react/no-danger */}
{descHtml && <div dangerouslySetInnerHTML={{ __html: descHtml }} />}
<PropTable metadata={metadata} />
</> | fix: added eslint pragma for ignoring dangerouslySetInnerHTML | react-bootstrap_react-bootstrap | train | js |
db550ca9e9b70d5c07ef58e8771e5f5c21aad751 | diff --git a/sample.js b/sample.js
index <HASH>..<HASH> 100644
--- a/sample.js
+++ b/sample.js
@@ -445,6 +445,8 @@ function generateWorkbook() {
var wb = generateWorkbook();
wb.write('Excel1.xlsx');
+console.log('Excel1.xlsx written');
+
wb.write('Excel.xlsx', function (err, stats) {
console.log('Excel.xlsx written and has the following stats');
console.log(stats); | small update to sample.js file | natergj_excel4node | train | js |
ca22dbd27bfae5178e254830fdf03da7c29a37f4 | diff --git a/lib/cucumber/salad/widgets/form.rb b/lib/cucumber/salad/widgets/form.rb
index <HASH>..<HASH> 100644
--- a/lib/cucumber/salad/widgets/form.rb
+++ b/lib/cucumber/salad/widgets/form.rb
@@ -40,21 +40,6 @@ module Cucumber
end
end
- def initialize(settings = {})
- s = settings.dup
- data = s.delete(:data) || {}
-
- super s
-
- fill_all data
-
- if block_given?
- yield self
-
- submit
- end
- end
-
def fill_all(attrs)
attrs.each do |k, v|
send "#{k}=", v | [form] Delete custom initialization.
The behavior can be replicated using other instance methods. | mojotech_capybara-ui | train | rb |
2066b9edb4fef584007ee439d0402c40fa9a2e4e | diff --git a/Siel/Acumulus/Shop/InvoiceManager.php b/Siel/Acumulus/Shop/InvoiceManager.php
index <HASH>..<HASH> 100644
--- a/Siel/Acumulus/Shop/InvoiceManager.php
+++ b/Siel/Acumulus/Shop/InvoiceManager.php
@@ -401,12 +401,11 @@ abstract class InvoiceManager
*
* After sending the invoice:
* - A successful result gets saved to the acumulus entries table.
- * - A mail with the results may be sent.
* - The invoice sent event gets triggered
+ * - A mail with the results may be sent.
*
* @param \Siel\Acumulus\Invoice\Source $invoiceSource
* @param array $invoice
- * param array $localMessages
* @param \Siel\Acumulus\Invoice\Result $result
*
* @return \Siel\Acumulus\Invoice\Result
@@ -433,12 +432,12 @@ abstract class InvoiceManager
}
}
- // Send a mail if there are messages.
- $this->mailInvoiceAddResult($result, $invoiceSource);
-
// Trigger the InvoiceSent event.
$this->triggerInvoiceSent($invoice, $invoiceSource, $result);
+ // Send a mail if there are messages.
+ $this->mailInvoiceAddResult($result, $invoiceSource);
+
return $result;
} | Trigger event InvoiceSent placed before sending mail | SIELOnline_libAcumulus | train | php |
71b9f19e6a314da2ea7c128397a1ef708144f740 | diff --git a/src/babel/build-external-helpers.js b/src/babel/build-external-helpers.js
index <HASH>..<HASH> 100644
--- a/src/babel/build-external-helpers.js
+++ b/src/babel/build-external-helpers.js
@@ -13,21 +13,15 @@ export default function (whitelist) {
buildHelpers(body, namespace, whitelist);
- var globalHelpersDeclar = t.variableDeclaration("var", [
- t.variableDeclarator(
- namespace,
- t.objectExpression({})
- )
- ]);
var container = util.template("umd-commonjs-strict", {
AMD_ARGUMENTS: t.arrayExpression([t.literal("exports")]),
COMMON_ARGUMENTS: t.identifier("exports"),
- BROWSER_ARGUMENTS: t.identifier("root"),
- UMD_ROOT: namespace,
+ BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression({})),
+ UMD_ROOT: t.identifier("this"),
FACTORY_PARAMETERS: t.identifier("global"),
FACTORY_BODY: body
});
- var tree = t.program([globalHelpersDeclar, container]);
+ var tree = t.program([container]);
return generator(tree).code;
}; | change to normal UMD (fixes bug with leaking variable in AMD mode) | babel_babel | train | js |
7c02209c983a44134e821645ce904a99a923db97 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -33,6 +33,9 @@ function Depsify(entries, opts) {
;[].concat(opts.transform).filter(Boolean).forEach(function (p) {
this.transform(p)
}, this)
+ ;[].concat(opts.processor).filter(Boolean).forEach(function (p) {
+ this.processor(p)
+ }, this)
;[].concat(opts.entries).filter(Boolean).forEach(function (file) {
this.add(file, { basedir: opts.basedir })
}, this)
@@ -77,7 +80,7 @@ Depsify.prototype._createPipeline = function (opts) {
}
Depsify.prototype._createDeps = function(opts) {
- opts = mix.fill({ transform: [] }, opts)
+ opts = mix.fill({ transform: [], processor: [] }, opts)
return MDeps(opts)
} | Apply processor in Depsify rather than css-module-deps | reducejs_depsify | train | js |
483e329c7aa200b7e10dcd9cf3aa513fb77c1d01 | diff --git a/protoc-gen-go/generator/generator.go b/protoc-gen-go/generator/generator.go
index <HASH>..<HASH> 100644
--- a/protoc-gen-go/generator/generator.go
+++ b/protoc-gen-go/generator/generator.go
@@ -1417,11 +1417,7 @@ func (g *Generator) goTag(message *Descriptor, field *descriptor.FieldDescriptor
name = name[i+1:]
}
}
- if name == CamelCase(fieldName) {
- name = ""
- } else {
- name = ",name=" + name
- }
+ name = ",name=" + name
if message.proto3() {
// We only need the extra tag for []byte fields;
// no need to add noise for the others. | Unconditionally generate the name= part of the protobuf struct field tag.
This is generated <I>% of the time anyway (since the standard style is to
name fields in snake_case, which gets turned into Go's CamelCase), but if
a .proto has a oneof field with a CamelCase name then some downstream code
can get confused. | golang_protobuf | train | go |
6f0a8b5d1f40b68f37b3ff1ea7651949c137049e | diff --git a/lib/ha-websocket.js b/lib/ha-websocket.js
index <HASH>..<HASH> 100644
--- a/lib/ha-websocket.js
+++ b/lib/ha-websocket.js
@@ -285,6 +285,15 @@ class HaWebsocket extends EventEmitter {
this.states[emitEvent.entity_id] = emitEvent.event.new_state;
}
+ // If old_state is null the state_changed was fired due to reloading of yaml files only send to events:all node
+ if (
+ emitEvent.event_type === 'state_changed' &&
+ emitEvent.event.old_state !== null
+ ) {
+ this.emit('ha_events:all', emitEvent);
+ return;
+ }
+
// Emit on the event type channel
if (emitEvent.event_type) {
this.emit(`ha_events:${msg.event_type}`, emitEvent); | fix: ignore state_changed event if old_state is null
* reloading of yaml files now triggers state_changed events
* only emit these events to the events:all node
Fixes #<I> | zachowj_node-red-contrib-home-assistant-websocket | train | js |
78fa49c849894b9cc13710cea11d66f9933d9c86 | diff --git a/plenum/test/consensus/order_service/test_sim_ordering_node_txn.py b/plenum/test/consensus/order_service/test_sim_ordering_node_txn.py
index <HASH>..<HASH> 100644
--- a/plenum/test/consensus/order_service/test_sim_ordering_node_txn.py
+++ b/plenum/test/consensus/order_service/test_sim_ordering_node_txn.py
@@ -119,6 +119,10 @@ def node_req_demote(random, sim_pool):
# "params" equal to seed
@pytest.fixture(params=Random().sample(range(1000000), 100))
def random(request):
+ seed = request.param
+ # TODO: Remove after we fix INDY-2237 and INDY-2148
+ if seed in {752248, 659043, 550513}:
+ return DefaultSimRandom(0)
return DefaultSimRandom(request.param) | add some seeds into a blacklist until INDY-<I> and INDY-<I> are fixed | hyperledger_indy-plenum | train | py |
716a6a59d561750a725e78699180be83f0d7ff28 | diff --git a/test/com/google/javascript/jscomp/DataFlowAnalysisTest.java b/test/com/google/javascript/jscomp/DataFlowAnalysisTest.java
index <HASH>..<HASH> 100644
--- a/test/com/google/javascript/jscomp/DataFlowAnalysisTest.java
+++ b/test/com/google/javascript/jscomp/DataFlowAnalysisTest.java
@@ -747,8 +747,7 @@ public final class DataFlowAnalysisTest extends TestCase {
// Compute liveness of variables
LiveVariablesAnalysis analysis =
- new LiveVariablesAnalysis(
- cfg, scope, childScope, compiler, (Es6SyntacticScopeCreator) scopeCreator);
+ new LiveVariablesAnalysis(cfg, scope, childScope, compiler, scopeCreator);
analysis.analyze();
return analysis.getEscapedLocals();
} | FIXUP: Remove an unnecessary cast
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
609efb2c61af1d4c4cd9e200f4d8fa3c84357140 | diff --git a/eve_elastic/elastic.py b/eve_elastic/elastic.py
index <HASH>..<HASH> 100644
--- a/eve_elastic/elastic.py
+++ b/eve_elastic/elastic.py
@@ -291,8 +291,8 @@ class Elastic(DataLayer):
ids = []
kwargs.update(self._es_args(resource))
for doc in doc_or_docs:
- doc.update(self.es.index(body=doc, id=doc.get('_id'), **kwargs))
- ids.append(doc['_id'])
+ res = self.es.index(body=doc, id=doc.get('_id'), **kwargs)
+ ids.append(res.get('_id', doc.get('_id')))
get_indices(self.es).refresh(self.index)
return ids | fix(insert): don't extend document on insert
it should avoid adding elastic internal data to docs like _version, _index, _type | petrjasek_eve-elastic | train | py |
1f8c7ff7a41429cf5e9f8b1f8011cde64b83971b | diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java b/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java
@@ -31,8 +31,6 @@ import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.annotation.Nullable;
-
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
@@ -328,7 +326,6 @@ public class ZooKeeperStateHandleStore<T extends Serializable> {
* @return True if the state handle could be released
* @throws Exception If the ZooKeeper operation or discarding the state handle fails
*/
- @Nullable
public boolean releaseAndTryRemove(String pathInZooKeeper) throws Exception {
checkNotNull(pathInZooKeeper, "Path in ZooKeeper"); | [hotfix][chck] Remove Nullable annotation from method with primitive return type
ZooKeeperStateHandleStore#releaseAndTryRemove returns a primitive boolean and, thus,
does not need a @Nullable annotation. | apache_flink | train | java |
f11b582576d128bc2742040b0a3cc89a485f1eee | diff --git a/werkzeug/templates.py b/werkzeug/templates.py
index <HASH>..<HASH> 100644
--- a/werkzeug/templates.py
+++ b/werkzeug/templates.py
@@ -233,16 +233,20 @@ class Parser(object):
elif name == 'if':
add(self.parse_if(args))
else:
- self.fail('unknown directive %S' % name)
+ self.fail('unknown directive %s' % name)
if needle:
self.fail('unexpected end of template')
return ast.Stmt(result, lineno=start_lineno)
def parse_loop(self, args, type):
rv = self.parse_python('%s %s: pass' % (type, args), 'exec').nodes[0]
- tag, value, rv.body = self.parse(('end' + type,))
+ tag, value, rv.body = self.parse(('end' + type, 'else'))
if value:
- self.fail('unexpected data after end' + type)
+ self.fail('unexpected data after ' + tag)
+ if tag == 'else':
+ tag, value, rv.else_ = self.parse(('end' + type,))
+ if value:
+ self.fail('unexpected data after else')
return rv
def parse_if(self, args): | added support for for-else / while-else
--HG--
branch : trunk | pallets_werkzeug | train | py |
6a2014ed4ede695eedaa81a8486ec07316fc5294 | diff --git a/test/test.py b/test/test.py
index <HASH>..<HASH> 100644
--- a/test/test.py
+++ b/test/test.py
@@ -16,16 +16,18 @@ from ase.units import GPa
import elastic
from elastic.parcalc import ParCalculate, ClusterVasp
-
+from elastic import BMEOS
def banner(msg):
print()
print(60*'=')
- print(msg)
+ print(min(0,(60-len(msg))//2-1)*' ',msg)
print(60*'=')
def secban(msg):
- print('\n',msg,'\n',60*'-')
+ print()
+ print(min(0,(60-len(msg))//2-1)*' ',msg)
+ print(60*'-')
banner('Structure optimization on MgO')
@@ -135,7 +137,7 @@ for cryst in crystals[:] :
print(cryst.get_vecang_cell())
print(cryst.bravais, cryst.sg_type, cryst.sg_name, cryst.sg_nr)
- view(cryst)
+ #view(cryst)
# Switch to cell shape+IDOF optimizer
calc.set(isif=4) | Typos/cosmetics and import BMEOS in tests. | jochym_Elastic | train | py |
b834a32b01af881e37d375121c8508f704e2692e | diff --git a/imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/YCbCrUpsamplerStream.java b/imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/YCbCrUpsamplerStream.java
index <HASH>..<HASH> 100644
--- a/imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/YCbCrUpsamplerStream.java
+++ b/imageio/imageio-tiff/src/main/java/com/twelvemonkeys/imageio/plugins/tiff/YCbCrUpsamplerStream.java
@@ -226,7 +226,7 @@ final class YCbCrUpsamplerStream extends FilterInputStream {
double lumaBlue = coefficients[2];
rgb[offset ] = clamp((int) Math.round(cr * (2 - 2 * lumaRed) + y));
- rgb[offset + 2] = clamp((int) Math.round(cb * (2 - 2 * lumaBlue) + y) - 128);
+ rgb[offset + 2] = clamp((int) Math.round(cb * (2 - 2 * lumaBlue) + y));
rgb[offset + 1] = clamp((int) Math.round((y - lumaRed * (rgb[offset] & 0xff) - lumaBlue * (rgb[offset + 2] & 0xff)) / lumaGreen));
} | TMI-TIFF: Minor bug introduced by testing.. | haraldk_TwelveMonkeys | train | java |
82db643b4f9c1496259de7c17750b8f2c59efc0d | diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php
+++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php
@@ -28,6 +28,7 @@ class DDC6303Test extends \Doctrine\Tests\OrmFunctionalTestCase
$contractA->originalData = $contractAData;
$contractB = new DDC6303ContractB();
+ //contractA and contractB have an inheritance from Contract, but one has a string originalData and the second has an array
$contractBData = ['accepted', 'authorized'];
$contractB->originalData = $contractBData;
@@ -61,7 +62,6 @@ class DDC6303Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
$contractStringEmptyData = '';
$contractStringZeroData = 0;
-
$contractArrayEmptyData = [];
$contractStringEmpty = new DDC6303ContractA();
@@ -151,4 +151,4 @@ class DDC6303ContractB extends DDC6303Contract
* @var array
*/
public $originalData;
-}
\ No newline at end of file
+} | clarified what's the problem in a comment | doctrine_orm | train | php |
e99d6b1bce1e8676ee3b4b0e267d029ce24064f5 | diff --git a/src/Monolog/Handler/MandrillHandler.php b/src/Monolog/Handler/MandrillHandler.php
index <HASH>..<HASH> 100644
--- a/src/Monolog/Handler/MandrillHandler.php
+++ b/src/Monolog/Handler/MandrillHandler.php
@@ -24,7 +24,7 @@ class MandrillHandler extends MailHandler
protected $message;
/**
- * @oaram string $apiKey A valid Mandrill API key
+ * @param string $apiKey A valid Mandrill API key
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
* @param integer $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not | Fixed a docblock typo in Mandrill handler | Seldaek_monolog | train | php |
5ebe19eb774ee487cd0670500622415ef43e9026 | diff --git a/src/com/zwitserloot/cmdreader/CmdReader.java b/src/com/zwitserloot/cmdreader/CmdReader.java
index <HASH>..<HASH> 100644
--- a/src/com/zwitserloot/cmdreader/CmdReader.java
+++ b/src/com/zwitserloot/cmdreader/CmdReader.java
@@ -308,9 +308,13 @@ public class CmdReader<T> {
sb.setLength(0);
if (p.equals("")) continue;
out.add(p);
+ continue;
}
+ sb.append(c);
}
+ if (sb.length() > 0) out.add(sb.toString());
+
return make(out.toArray(new String[out.size()]));
} | Bugfix; the make(String) version wasn't working at all, though I hadn't noticed until now because I always used make(String[]). | rzwitserloot_com.zwitserloot.cmdreader | train | java |
a82e9ada37104cd78a236a4ca6aec17bea5b6f74 | diff --git a/lib/editor/tinymce/module.js b/lib/editor/tinymce/module.js
index <HASH>..<HASH> 100644
--- a/lib/editor/tinymce/module.js
+++ b/lib/editor/tinymce/module.js
@@ -80,20 +80,11 @@ M.editor_tinymce.onblur_event = function(ed) {
//have loaded contents and submitting form should not throw error.
ed.save();
- //Attach blur event for tinymce to call onchange validation function of textarea.
+ //Attach blur event for tinymce to save contents to textarea
var doc = s.content_editable ? ed.getBody() : (tinymce.isGecko ? ed.getDoc() : ed.getWin());
tinymce.dom.Event.add(doc, 'blur', function() {
//save contents to textarea before calling validation script.
ed.save();
- var element = document.getElementById(ed.id);
- element.onchange(element);
- });
-
- //Add an extra event to make sure after window is blurred because of user clicking
- //out of tinymce or any popup occured, then error should be cleaned on focusing back.
- tinymce.dom.Event.add(doc, 'focus', function() {
- var element = document.getElementById(ed.id);
- qf_errorHandler(element, '');
});
};
}; | MDL-<I> Forms Library: Removed onBlur validation. Now the validation will occur on form submit only | moodle_moodle | train | js |
6b4951f48adabec87ff3b2a3e4f3854a61dd76f8 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -30,6 +30,9 @@ module.exports = function(grunt) {
// Configuration to be run (and then tested).
responsive_images: {
+ options: {
+ engine: 'im'
+ },
default_options: {
options: {
}, | Changed tests to use ImageMagick as Travis-CI does not have GraphicsMagick installed | andismith_grunt-responsive-images | train | js |
ad4cd5619022f843fd2c550f7ccc592cc7bf44a8 | diff --git a/container/utils/visibility.py b/container/utils/visibility.py
index <HASH>..<HASH> 100644
--- a/container/utils/visibility.py
+++ b/container/utils/visibility.py
@@ -91,7 +91,6 @@ def alternate_dev_formatter():
def with_memoized_loggers(logger, call_name, event_dict):
if logger.getEffectiveLevel() > logging.DEBUG:
return info_formatter(logger, call_name, event_dict)
- return standard(logger, call_name, event_dict)
return debugging(logger, call_name, event_dict)
return with_memoized_loggers | Remove useless statement (#<I>)
Thanks to pyflakes | ansible_ansible-container | train | py |
c07207f219268010ace0dc6c35b518e990b2865b | diff --git a/src/util/Util.js b/src/util/Util.js
index <HASH>..<HASH> 100644
--- a/src/util/Util.js
+++ b/src/util/Util.js
@@ -483,11 +483,11 @@ class Util extends null {
* @returns {Collection}
*/
static discordSort(collection) {
+ const isGuildChannel = collection.first() instanceof GuildChannel;
return collection.sorted(
- (a, b) =>
- a.rawPosition - b.rawPosition ||
- parseInt(b.id.slice(0, -10)) - parseInt(a.id.slice(0, -10)) ||
- parseInt(b.id.slice(10)) - parseInt(a.id.slice(10)),
+ isGuildChannel
+ ? (a, b) => a.rawPosition - b.rawPosition || Number(BigInt(a.id) - BigInt(b.id))
+ : (a, b) => a.rawPosition - b.rawPosition || Number(BigInt(b.id) - BigInt(a.id)),
);
}
@@ -616,3 +616,6 @@ class Util extends null {
}
module.exports = Util;
+
+// Fixes Circular
+const GuildChannel = require('../structures/GuildChannel'); | fix(Util): fix sorting for GuildChannels (#<I>) | discordjs_discord.js | train | js |
ea20fd03df4262ad4e7c18f5fedd7e2ea751c135 | diff --git a/internal/goofys_test.go b/internal/goofys_test.go
index <HASH>..<HASH> 100644
--- a/internal/goofys_test.go
+++ b/internal/goofys_test.go
@@ -3998,3 +3998,28 @@ func (s *GoofysTest) TestIssue474(t *C) {
t.Assert(err, IsNil)
s.assertEntries(t, dir2, []string{"c"})
}
+
+func (s *GoofysTest) TestReadExternalChangesFuse(t *C) {
+ s.fs.flags.StatCacheTTL = 1 * time.Second
+
+ mountPoint := "/tmp/mnt" + s.fs.bucket
+
+ s.mount(t, mountPoint)
+ defer s.umount(t, mountPoint)
+
+ buf, err := ioutil.ReadFile(mountPoint + "/file1")
+ t.Assert(err, IsNil)
+ t.Assert(string(buf), Equals, "file1")
+
+ _, err = s.cloud.PutBlob(&PutBlobInput{
+ Key: "file1",
+ Body: bytes.NewReader([]byte("newfile")),
+ })
+ t.Assert(err, IsNil)
+
+ time.Sleep(1 * time.Second)
+
+ buf, err = ioutil.ReadFile(mountPoint + "/file1")
+ t.Assert(err, IsNil)
+ t.Assert(string(buf), Equals, "newfile")
+} | add a test for external changes after data is in page cache | kahing_goofys | train | go |
4a26a6467e58b1e95bab402038466166b5bf9b12 | diff --git a/src/views/layouts/blank.php b/src/views/layouts/blank.php
index <HASH>..<HASH> 100644
--- a/src/views/layouts/blank.php
+++ b/src/views/layouts/blank.php
@@ -9,6 +9,7 @@
<?= Decoy::title() ?>
<meta name="viewport" content="width=device-width"/>
<meta name="csrf" content="<?=Session::getToken()?>"/>
+ <link rel="stylesheet" href="<?=HTML::grunt('/css/admin/vendor.css')?>"/>
<link rel="stylesheet" href="<?=HTML::grunt('/css/admin/style.css')?>"/>
<script src="/packages/bkwld/decoy/ckeditor/ckeditor.js"></script>
<script src="/packages/bkwld/decoy/ckfinder/ckfinder.js"></script> | Adding the new vendor.css to the login page | BKWLD_decoy | train | php |
cdf83ad2fc5653072b9eecbcd8d6944c4bb73008 | diff --git a/internal/atlas/image.go b/internal/atlas/image.go
index <HASH>..<HASH> 100644
--- a/internal/atlas/image.go
+++ b/internal/atlas/image.go
@@ -576,6 +576,10 @@ func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, pixels []byte
backendsM.Lock()
defer backendsM.Unlock()
+ // In the tests, BeginFrame might not be called often and then images might not be disposed (#2292).
+ // To prevent memory leaks, resolve the deferred functions here.
+ resolveDeferred()
+
if i.backend == nil || i.backend.restorable == nil {
for i := range pixels {
pixels[i] = 0
diff --git a/internal/graphicsdriver/directx/graphics_windows.go b/internal/graphicsdriver/directx/graphics_windows.go
index <HASH>..<HASH> 100644
--- a/internal/graphicsdriver/directx/graphics_windows.go
+++ b/internal/graphicsdriver/directx/graphics_windows.go
@@ -778,6 +778,7 @@ func (g *Graphics) End(present bool) error {
if err := g.waitForCommandQueue(); err != nil {
return err
}
+ g.releaseResources(g.frameIndex)
g.releaseVerticesAndIndices(g.frameIndex)
} | internal/atlas: dispose images at ReadPixels
Without resolveDeferred() at ReadPixels, many images are never disposed
in tests.
Updates #<I> | hajimehoshi_ebiten | train | go,go |
1de5550403bdde68a413f4c2e1519cd4c9722156 | diff --git a/src/Network/Request.php b/src/Network/Request.php
index <HASH>..<HASH> 100644
--- a/src/Network/Request.php
+++ b/src/Network/Request.php
@@ -577,8 +577,10 @@ class Request implements ArrayAccess
{
if (strpos($name, 'is') === 0) {
$type = strtolower(substr($name, 2));
-
- return $this->is($type);
+
+ array_unshift($params, $type);
+
+ return call_user_func_array([$this, 'is'], $params);
}
throw new BadMethodCallException(sprintf('Method %s does not exist', $name));
} | fixed bug on `__call()` method | cakephp_cakephp | train | php |
68891a3af5af5771db0e18d6bc1fac406bc1f680 | diff --git a/tests/test_CK.py b/tests/test_CK.py
index <HASH>..<HASH> 100644
--- a/tests/test_CK.py
+++ b/tests/test_CK.py
@@ -19,5 +19,6 @@ class TestUtil(unittest.TestCase):
def test_CKR(self):
self.assertEqual(PyKCS11.CKR_VENDOR_DEFINED, 0x80000000)
+
if __name__ == '__main__':
unittest.main() | Fix pycodestyle errors
test_CK.py:<I>:1: E<I> expected 2 blank lines after class or function definition, found 1 | LudovicRousseau_PyKCS11 | train | py |
1f6b9eab61594955104a37d5f399ac67683d95fa | diff --git a/userena/contrib/umessages/fields.py b/userena/contrib/umessages/fields.py
index <HASH>..<HASH> 100644
--- a/userena/contrib/umessages/fields.py
+++ b/userena/contrib/umessages/fields.py
@@ -12,7 +12,7 @@ class CommaSeparatedUserInput(widgets.Input):
value = ''
elif isinstance(value, (list, tuple)):
value = (', '.join([user.username for user in value]))
- return super().render(name, value, attrs, renderer)
+ return super(CommaSeparatedUserInput, self).render(name, value, attrs, renderer)
class CommaSeparatedUserField(forms.Field):
""" | Blank super is not allowed in Python <I>
Still supported by Django <I> | django-userena-ce_django-userena-ce | train | py |
dc8a106eb0326832984984080704cbde6b2309f5 | diff --git a/about_time/about_time.py b/about_time/about_time.py
index <HASH>..<HASH> 100644
--- a/about_time/about_time.py
+++ b/about_time/about_time.py
@@ -106,3 +106,33 @@ class HandleResult(Handle):
@property
def result(self):
return self.__result
+
+
+class HandleStats(Handle):
+ def __init__(self, timings, count):
+ super().__init__(timings)
+ self.__count = count
+
+ @property
+ def count(self):
+ return self.__count
+
+ @property
+ def throughput(self):
+ return self.count / self.duration
+
+ @property
+ def throughput_human(self):
+ value = self.throughput
+ spec = (
+ (1. / 60, 60 * 60, 60, '/h'),
+ (1., 60, 60, '/m'),
+ )
+ for top, mult, size, unit in spec:
+ if value < top:
+ result = round(value * mult, ndigits=2)
+ if result < size:
+ return '{}{}'.format(result, unit)
+
+ result = round(value, ndigits=2)
+ return '{}{}'.format(result, '/s') | feat(*) new counter and throughput class | rsalmei_about-time | train | py |
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.