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
5485b0df48fd2410ea68ac8a061835378fc39332
diff --git a/code/libraries/koowa/mixin/toolbar.php b/code/libraries/koowa/mixin/toolbar.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/mixin/toolbar.php +++ b/code/libraries/koowa/mixin/toolbar.php @@ -97,7 +97,9 @@ class KMixinToolbar extends KMixinAbstract $this->_toolbars[$toolbar->getIdentifier()->name] = $toolbar; //Add the toolbar - $this->addEventSubscriber($toolbar, $priority); + if($this->inherits('KMixinEvent')) { + $this->addEventSubscriber($toolbar, $priority); + } return $this->getMixer(); }
re #<I> : Added extra check to make sure we are inheriting from KMixinEvent
joomlatools_joomlatools-framework
train
php
020b8024328d9269ba614005d4b3245f08f58247
diff --git a/src/pybel/manager/cache.py b/src/pybel/manager/cache.py index <HASH>..<HASH> 100644 --- a/src/pybel/manager/cache.py +++ b/src/pybel/manager/cache.py @@ -150,7 +150,7 @@ class CacheManager(BaseCacheManager): """Returns a list of the locations of the stored namespaces and annotations :return: A list of all namespaces in the relational database. - :rtype: list[url or dict] + :rtype: list """ if url:
Fix problem with documentation [skip ci]
pybel_pybel
train
py
6fdf276e45a446a3c707c2c9812cb29be82986b4
diff --git a/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java b/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java index <HASH>..<HASH> 100644 --- a/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java +++ b/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java @@ -156,6 +156,13 @@ public class CommonPoolImpl implements CommonPool if (this.minPoolSize != null && this.minPoolSize < 0) throw new ValidateException(bundle.invalidNegative(Tag.MIN_POOL_SIZE.getLocalName())); + if (this.minPoolSize != null && this.maxPoolSize != null) + { + if (minPoolSize.intValue() > maxPoolSize.intValue()) + throw new ValidateException(bundle.notValidNumber(minPoolSize.toString(), + Tag.MIN_POOL_SIZE.getLocalName())); + } + if (this.flushStrategy == null) throw new ValidateException(bundle.nullValue(Tag.FLUSH_STRATEGY.getLocalName())); }
Make sure that max-pool-size is greater than or equal to min-pool-size
ironjacamar_ironjacamar
train
java
3cdde05db1eaa07236e00421e710f21e311c3ebe
diff --git a/tests/glesys/requests/compute/helper.rb b/tests/glesys/requests/compute/helper.rb index <HASH>..<HASH> 100644 --- a/tests/glesys/requests/compute/helper.rb +++ b/tests/glesys/requests/compute/helper.rb @@ -122,7 +122,7 @@ class Glesys 'current' => Fog::Nullable::Integer, 'unit' => String }, - 'warnings' => [] + 'warnings' => Array }, 'status' => { 'timestamp' => String,
[glesys] Make compute test pass
fog_fog
train
rb
01635fa9054cf521a3b2699f97e377ba07fc6703
diff --git a/input/composites/_observable.js b/input/composites/_observable.js index <HASH>..<HASH> 100644 --- a/input/composites/_observable.js +++ b/input/composites/_observable.js @@ -44,6 +44,7 @@ Input.prototype = Object.create(DOMInput.prototype, { forEach(getInputValue.call(this), function (value, keyPath) { var names = tokenize(keyPath), propName = names.pop(), name , obj = mock, dbjsObj = this.observable.object; + names.shift(); // clear object id= while ((name = names.shift())) { if (!obj.hasOwnProperty(name)) { defineProperty(obj, name, d('cew', {}));
Assure to not process object id
medikoo_dbjs-dom
train
js
559b830de56195e722b0801ca0088d88c336d978
diff --git a/lib/mqtt/version.rb b/lib/mqtt/version.rb index <HASH>..<HASH> 100644 --- a/lib/mqtt/version.rb +++ b/lib/mqtt/version.rb @@ -1,3 +1,3 @@ module MQTT - VERSION = "0.0.6" + VERSION = "0.0.7" end
Incremented version number to <I>
njh_ruby-mqtt
train
rb
0494cdf33cbd69e4153ad0207a18138df08915ee
diff --git a/components.go b/components.go index <HASH>..<HASH> 100644 --- a/components.go +++ b/components.go @@ -51,6 +51,7 @@ func (umc *unmarshalableMessageComponent) UnmarshalJSON(src []byte) error { return json.Unmarshal(src, umc.MessageComponent) } +// MessageComponentFromJSON is a helper function for unmarshaling message components func MessageComponentFromJSON(b []byte) (MessageComponent, error) { var u unmarshalableMessageComponent err := u.UnmarshalJSON(b)
feat(components): added comment to MessageComponentFromJSON
bwmarrin_discordgo
train
go
2c80da26ffc59d941b8dbc0012784a1750dd81f8
diff --git a/lib/OpenLayers/Layer/WMS/Untiled.js b/lib/OpenLayers/Layer/WMS/Untiled.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Layer/WMS/Untiled.js +++ b/lib/OpenLayers/Layer/WMS/Untiled.js @@ -108,7 +108,7 @@ OpenLayers.Layer.WMS.Untiled.prototype = */ moveTo:function(bounds, zoomChanged, minor) { - if (!minor) { + if (!minor || zoomChanged) { if (bounds == null) { bounds = this.map.getExtent();
Untiled WMS layer didn't change on zoom. Now it should. git-svn-id: <URL>
openlayers_openlayers
train
js
b5d55d1075f3924eeef2767998f4f9db87c7e271
diff --git a/File/src/File.php b/File/src/File.php index <HASH>..<HASH> 100644 --- a/File/src/File.php +++ b/File/src/File.php @@ -195,7 +195,12 @@ class File implements FileInterface if (!$this->mkdir(dirname($this->filename))) { throw new \RuntimeException('Creating directory failed for ' . $this->filename); } - $this->handle = fopen($this->filename, 'wb+'); + $this->handle = @fopen($this->filename, 'wb+'); + if (!$this->handle) { + $error = error_get_last(); + + throw new \RuntimeException("Opening file '{$this->filename}' for writing failed on error {$error['message']}"); + } } $lock = $block ? LOCK_EX : LOCK_EX | LOCK_NB; return $this->locked = $this->handle ? flock($this->handle, $lock) : false;
Catch the error if opening file in File::lock() fails
rockettheme_toolbox
train
php
0b0fa9d47babfc8b91a7e21662bc2b09fd5e3d24
diff --git a/client/boot/common.js b/client/boot/common.js index <HASH>..<HASH> 100644 --- a/client/boot/common.js +++ b/client/boot/common.js @@ -40,7 +40,12 @@ const setupContextMiddleware = reduxStore => { const parsed = url.parse( context.canonicalPath, true ); context.pathname = parsed.pathname; context.prevPath = parsed.path === context.path ? false : parsed.path; - context.path = parsed.path; + + // allow external urls to pass through, by not rewriting context.path in this case + if ( ! startsWith( context.path, 'http' ) ) { + context.path = parsed.path; + } + context.query = parsed.query; context.hashstring = ( parsed.hash && parsed.hash.substring( 1 ) ) || '';
Do not rewrite context.path for external urls
Automattic_wp-calypso
train
js
f0d33367f6341ca14894eaed0112d619d74151b7
diff --git a/lib/boletosimples/version.rb b/lib/boletosimples/version.rb index <HASH>..<HASH> 100644 --- a/lib/boletosimples/version.rb +++ b/lib/boletosimples/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module BoletoSimples - VERSION = '1.0.0' + VERSION = '1.0.1' end
Bump boletosimples to <I>
BoletoSimples_boletosimples-ruby
train
rb
20d282100b086389a00c00f3a14401cf6fb5fcac
diff --git a/src/BEAR/Resource/AbstractObject.php b/src/BEAR/Resource/AbstractObject.php index <HASH>..<HASH> 100644 --- a/src/BEAR/Resource/AbstractObject.php +++ b/src/BEAR/Resource/AbstractObject.php @@ -104,13 +104,17 @@ abstract class AbstractObject implements Object, \ArrayAccess, \Countable, \Iter { if ($this->renderer) { if (is_null($this->representation)) { - $this->representation = $this->renderer->render($this); + try { + $this->representation = $this->renderer->render($this); + } catch (\Exception $e) { + error_log((string)$e); + return ''; + } + $string = $this->representation; + } else { + $string = get_class($this) . '#' . md5(serialize($this->body)); } - $string = $this->representation; - } else { - $string = get_class($this) . '#' . md5(serialize($this->body)); + return $string; } - return $string; } - } \ No newline at end of file
Catch exception in __toString.
bearsunday_BEAR.Resource
train
php
4ce22f8b65db38e1133183af63ef2d3de53a4a0f
diff --git a/spiceypy/tests/test_wrapper.py b/spiceypy/tests/test_wrapper.py index <HASH>..<HASH> 100644 --- a/spiceypy/tests/test_wrapper.py +++ b/spiceypy/tests/test_wrapper.py @@ -3942,7 +3942,7 @@ def test_gfevnt(): udrepu = spiceypy.utils.callbacks.SpiceUDREPU(spice.gfrepu) udrepf = spiceypy.utils.callbacks.SpiceUDREPF(spice.gfrepf) udbail = spiceypy.utils.callbacks.SpiceUDBAIL(spice.gfbail) - qdpars = np.zeros(10, dtype=np.float) + qdpars = np.zeros(10, dtype=float) qipars = np.zeros(10, dtype=np.int32) qlpars = np.zeros(10, dtype=np.int32) # call gfevnt
fixed a warning in a test
AndrewAnnex_SpiceyPy
train
py
3783f4845468fd90586ae65eccfaf802dd33909f
diff --git a/src/Aws/S3/Resources/s3-2006-03-01.php b/src/Aws/S3/Resources/s3-2006-03-01.php index <HASH>..<HASH> 100644 --- a/src/Aws/S3/Resources/s3-2006-03-01.php +++ b/src/Aws/S3/Resources/s3-2006-03-01.php @@ -3933,6 +3933,25 @@ return array ( ), ), ), + 'Prefix' => array( + 'type' => 'string', + 'location' => 'xml', + ), + 'CommonPrefixes' => array( + 'type' => 'array', + 'location' => 'xml', + 'data' => array( + 'xmlFlattened' => true, + ), + 'items' => array( + 'type' => 'object', + 'properties' => array( + 'Prefix' => array( + 'type' => 'string', + ), + ), + ), + ), 'RequestId' => array( 'location' => 'header', 'sentAs' => 'x-amz-request-id',
Fixed an unmarshalling error with the Amazon S3 ListMultipartUploads operation
aws_aws-sdk-php
train
php
24e25bc124025a4dac6c461191a30305e45521e7
diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index <HASH>..<HASH> 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -63,7 +63,7 @@ class moodleform_mod extends moodleform { */ function standard_coursemodule_elements($supportsgroups=true){ $mform =& $this->_form; - $mform->addElement('header', '', get_string('modstandardels', 'form')); + $mform->addElement('header', 'modstandardelshdr', get_string('modstandardels', 'form')); if ($supportsgroups){ $mform->addElement('modgroupmode', 'groupmode', get_string('groupmode')); }
small change to fix MDL-<I> which was a problem with non unique header element names
moodle_moodle
train
php
aba7621ea0859098fcad8726b87386812538e0ff
diff --git a/src/Events/ServiceEvent.php b/src/Events/ServiceEvent.php index <HASH>..<HASH> 100644 --- a/src/Events/ServiceEvent.php +++ b/src/Events/ServiceEvent.php @@ -1,7 +1,7 @@ <?php namespace DreamFactory\Core\Events; -abstract class ServiceEvent extends Event +class ServiceEvent extends Event { public $resource; public $data;
Make ServiceEvent newable, no abstractions there.
dreamfactorysoftware_df-core
train
php
36b1e8d238c3db00659623034bd5fe284043a7f0
diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index <HASH>..<HASH> 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -1,6 +1,9 @@ -const defaultConfig = require('./../webpack.config'); +const { + baseConfig, + hostConfig +} = require('./../webpack.base.config'); -module.exports = Object.assign({}, defaultConfig, { +module.exports = Object.assign({}, baseConfig, hostConfig, { module: { loaders: [ {
BUGFIX: fix react-storybook
neos_neos-ui
train
js
f0a7e6e01e4c366edccf0ca84acc7a1beede58e2
diff --git a/tensorflow_probability/python/distributions/jax_transformation_test.py b/tensorflow_probability/python/distributions/jax_transformation_test.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/distributions/jax_transformation_test.py +++ b/tensorflow_probability/python/distributions/jax_transformation_test.py @@ -106,6 +106,7 @@ VJP_LOGPROB_PARAM_BLOCKLIST = ( PYTREE_BLOCKLIST = ( 'Bates', + 'MixtureSameFamily', # Too slow: http://b/170871051 'TransformedDistribution', )
Suppress Jax PytreeTest.testInputOutputOfJittedFunctionMixtureSameFamily due to unexplained long tail of runtimes. PiperOrigin-RevId: <I>
tensorflow_probability
train
py
01f246b9e589e3ae78c2194388b181bb80c853f9
diff --git a/spec/core/font_spec.js b/spec/core/font_spec.js index <HASH>..<HASH> 100644 --- a/spec/core/font_spec.js +++ b/spec/core/font_spec.js @@ -26,6 +26,10 @@ describe('Font', function () { expect(quote("'family 1', 'family 2'")).toEqual("'family 1','family 2'"); }); + it('should quote family names starting with a number', function () { + expect(quote('5test')).toEqual("'5test'"); + }); + it('should not quote when there is no space', function () { expect(quote('MyFamily')).toEqual('MyFamily'); }); diff --git a/src/core/font.js b/src/core/font.js index <HASH>..<HASH> 100644 --- a/src/core/font.js +++ b/src/core/font.js @@ -61,7 +61,7 @@ goog.scope(function () { var split = name.split(/,\s*/); for (var i = 0; i < split.length; i++) { var part = split[i].replace(/['"]/g, ''); - if (part.indexOf(' ') == -1) { + if (part.indexOf(' ') == -1 && !(/^\d/.test(part))) { quoted.push(part); } else { quoted.push("'" + part + "'");
Fix unquoted numbers in font family names.
typekit_webfontloader
train
js,js
0de01a1840de13c4a6292d310180808f758ae435
diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentProducer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentProducer.java index <HASH>..<HASH> 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentProducer.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentProducer.java @@ -147,7 +147,9 @@ class DocumentProducer<T extends Resource> { this.correlatedActivityId = correlatedActivityId; - this.cosmosQueryRequestOptions = cosmosQueryRequestOptions != null ? cosmosQueryRequestOptions : new CosmosQueryRequestOptions(); + this.cosmosQueryRequestOptions = cosmosQueryRequestOptions != null ? + ModelBridgeInternal.createQueryRequestOptions(cosmosQueryRequestOptions) + : new CosmosQueryRequestOptions(); ModelBridgeInternal.setQueryRequestOptionsContinuationToken(this.cosmosQueryRequestOptions, initialContinuationToken); this.lastResponseContinuationToken = initialContinuationToken; this.resourceType = resourceType;
Fix to prevent a race condition in continuation token. This was part of the earlier V4 branch, but got overwritten during merge. (#<I>)
Azure_azure-sdk-for-java
train
java
94423a7d04586f56fe63e0cb26821bc207ad164d
diff --git a/blob/BlobBackendBase.js b/blob/BlobBackendBase.js index <HASH>..<HASH> 100644 --- a/blob/BlobBackendBase.js +++ b/blob/BlobBackendBase.js @@ -172,7 +172,8 @@ define(['blob/BlobMetadata', var readStream = fs.createReadStream(tempFile); - writeStream.on('finish', function() { + // FIXME: is finish/end/close the right event? + writeStream.on('close', function() { callback(null, metadata); fs.unlink(tempFile, function (){
Listen to 'close' event instead of 'finish'. Former-commit-id: <I>beed<I>df<I>fb<I>fadcc<I>a0c<I>
webgme_webgme-engine
train
js
0e3686edf479ab670a53d336e1af30ce456cfb77
diff --git a/hazelcast/src/main/java/com/hazelcast/internal/jmx/WanPublisherMBean.java b/hazelcast/src/main/java/com/hazelcast/internal/jmx/WanPublisherMBean.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/internal/jmx/WanPublisherMBean.java +++ b/hazelcast/src/main/java/com/hazelcast/internal/jmx/WanPublisherMBean.java @@ -27,7 +27,7 @@ import java.util.Map; * WAN publishers do not share a single common interface, we need to access * them through the WAN replication service until such an interface is introduced. */ -@ManagedDescription("WanReplicationPublisher") +@ManagedDescription("WanPublisher") public class WanPublisherMBean extends HazelcastMBean<WanReplicationService> { private final String wanReplicationName; private final String wanPublisherId; @@ -39,7 +39,7 @@ public class WanPublisherMBean extends HazelcastMBean<WanReplicationService> { super(wanReplicationService, service); this.wanReplicationName = wanReplicationName; this.wanPublisherId = wanPublisherId; - this.objectName = service.createObjectName("WanReplicationPublisher", + this.objectName = service.createObjectName("WanPublisher", wanReplicationName + "." + wanPublisherId); }
Rename WAN MBean Rename the MBean from WanReplicationPublisher to WanPublisher.
hazelcast_hazelcast
train
java
03155917c7a8ecfdaf8f48ad54ac5d1a00fc0358
diff --git a/src/SleepingOwl/Admin/Models/Form/FormItem/Select.php b/src/SleepingOwl/Admin/Models/Form/FormItem/Select.php index <HASH>..<HASH> 100644 --- a/src/SleepingOwl/Admin/Models/Form/FormItem/Select.php +++ b/src/SleepingOwl/Admin/Models/Form/FormItem/Select.php @@ -55,9 +55,16 @@ class Select extends BaseFormItem return $select; } + /** + * @param array $values + * + * @return $this + */ public function enum($values) { $this->list(array_combine($values, $values)); + + return $this; } function __call($name, $arguments)
Allow chaining enum() method of SelectFormItem
sleeping-owl_admin
train
php
3e28279dd1357115ed8e7edfb2c466d9a17b4154
diff --git a/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java b/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java index <HASH>..<HASH> 100644 --- a/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java +++ b/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java @@ -162,8 +162,8 @@ public class ThriftToPig<M extends TBase<?, ?>> { HashMap<String, Object> out = new HashMap<String, Object>(map.size()); Field valueField = field.getMapValueField(); for(Entry<Object, Object> e : map.entrySet()) { - Object prev = out.put(e.getKey().toString(), - toPigObject(valueField, e.getValue(), lazy)); + String key = e.getKey() == null ? null : e.getKey().toString(); + Object prev = out.put(key, toPigObject(valueField, e.getValue(), lazy)); if (prev != null) { String msg = "Duplicate keys while converting to String while " + " processing map " + field.getName() + " (key type : "
null key in a map should be tolerated. Pig and Thrift are ok with it.
twitter_elephant-bird
train
java
3e888ba4c4dc447831f5016688f9345e2adaedf3
diff --git a/ipywidgets/widgets/widget_selection.py b/ipywidgets/widgets/widget_selection.py index <HASH>..<HASH> 100644 --- a/ipywidgets/widgets/widget_selection.py +++ b/ipywidgets/widgets/widget_selection.py @@ -85,10 +85,10 @@ class _Selection(DOMWidget): self.set_trait('_options_dict', { i[0]: i[1] for i in options }) self.set_trait('_options_labels', [ i[0] for i in options ]) self.set_trait('_options_values', [ i[1] for i in options ]) - self._value_in_options() return new - def _value_in_options(self): + @observe('options') + def _value_in_options(self, change): # ensure that the chosen value is one of the choices if self._options_values: if self.value not in self._options_values: @@ -124,7 +124,8 @@ class _MultipleSelection(_Selection): value = Tuple(help="Selected values").tag(sync=True, to_json=_values_to_labels, from_json=_labels_to_values) - def _value_in_options(self): + @observe('options') + def _value_in_options(self, change): new_value = [] for v in self.value: if v in self._options_dict.values():
Allow options to coerce selection value
jupyter-widgets_ipywidgets
train
py
7dfcd3bfffc20dcee30cd047bb527112f28b1e5d
diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py index <HASH>..<HASH> 100644 --- a/tests/test_connection_pool.py +++ b/tests/test_connection_pool.py @@ -143,8 +143,8 @@ class TestBlockingConnectionPool(object): time.sleep(0.1) pool.release(c1) - Thread(target=target).start() start = time.time() + Thread(target=target).start() pool.get_connection('_') assert time.time() - start >= 0.1
Attempt to fix a timing bug
andymccurdy_redis-py
train
py
b07848359bea48c8bb5c10b8250cc8b9ff6f26ef
diff --git a/jax/nn/__init__.py b/jax/nn/__init__.py index <HASH>..<HASH> 100644 --- a/jax/nn/__init__.py +++ b/jax/nn/__init__.py @@ -15,6 +15,10 @@ """Common functions for neural network libraries.""" # flake8: noqa: F401 + +# TODO(phawkins): remove this import after fixing callers +from . import functions + from . import initializers from jax._src.nn.functions import ( celu,
Import jax.nn.functions by default to fix breakage.
tensorflow_probability
train
py
b5243fb3a5151d65f3caa689d01a573809c441f2
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb index <HASH>..<HASH> 100644 --- a/lib/chef/api_client/registration.rb +++ b/lib/chef/api_client/registration.rb @@ -33,9 +33,10 @@ class Chef attr_reader :destination attr_reader :name - def initialize(name, destination) - @name = name - @destination = destination + def initialize(name, destination, http_api: nil) + @name = name + @destination = destination + @http_api = http_api @server_generated_private_key = nil end @@ -120,11 +121,10 @@ class Chef post_data end - def http_api - @http_api_as_validator ||= Chef::REST.new(Chef::Config[:chef_server_url], - Chef::Config[:validation_client_name], - Chef::Config[:validation_key]) + @http_api ||= Chef::REST.new(Chef::Config[:chef_server_url], + Chef::Config[:validation_client_name], + Chef::Config[:validation_key]) end # Whether or not to generate keys locally and post the public key to the @@ -161,5 +161,3 @@ class Chef end end end - -
allow dep injecting the http client
chef_chef
train
rb
62d879d3178864203b3df85826b2f9798d518243
diff --git a/client/driver/rkt.go b/client/driver/rkt.go index <HASH>..<HASH> 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -143,7 +143,7 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e d.logger.Printf("[DEBUG] driver.rkt: added trust prefix: %q", trustPrefix) } else { // Disble signature verification if the trust command was not run. - cmdArgs = append(cmdArgs, "--insecure-skip-verify") + cmdArgs = append(cmdArgs, "--insecure-options=all") } // Inject the environment variables.
Update the insecure flag The current call has been deprecated in <URL>
hashicorp_nomad
train
go
d4d08e49008a644f545b4fdaf0b0e311b09999b4
diff --git a/lib/jsonapi/request.rb b/lib/jsonapi/request.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/request.rb +++ b/lib/jsonapi/request.rb @@ -384,7 +384,8 @@ module JSONAPI } end - if !raw.is_a?(Hash) || raw.length != 2 || !(raw.key?('type') && raw.key?('id')) + if !(raw.is_a?(Hash) || raw.is_a?(ActionController::Parameters)) || + raw.keys.length != 2 || !(raw.key?('type') && raw.key?('id')) fail JSONAPI::Exceptions::InvalidLinksObject.new end @@ -516,7 +517,7 @@ module JSONAPI params.each do |key, value| case key.to_s when 'relationships' - value.each_key do |links_key| + value.keys.each do |links_key| unless formatted_allowed_fields.include?(links_key.to_sym) params_not_allowed.push(links_key) unless JSONAPI.configuration.raise_if_parameters_not_allowed
Updating the treatment of parameters to work when they are ActionController::Parameters which is how they are returned in rails 5 See <URL>
cerebris_jsonapi-resources
train
rb
c3cfb1fbb980511d1e33ef111e0fbdc3336e26b3
diff --git a/plugins/show-invisibles/prism-show-invisibles.js b/plugins/show-invisibles/prism-show-invisibles.js index <HASH>..<HASH> 100644 --- a/plugins/show-invisibles/prism-show-invisibles.js +++ b/plugins/show-invisibles/prism-show-invisibles.js @@ -7,13 +7,12 @@ if ( return; } -for (var language in Prism.languages) { - var tokens = Prism.languages[language]; - - tokens.tab = /\t/g; - tokens.crlf = /\r\n/g; - tokens.lf = /\n/g; - tokens.cr = /\r/g; -} +Prism.hooks.add('before-highlight', function(env) { + var tokens = env.grammar; + tokens.tab = /\t/g; + tokens.crlf = /\r\n/g; + tokens.lf = /\n/g; + tokens.cr = /\r/g; +}); })();
Ensure show-invisibles compat with autoloader When using the autoloader, the language isn't loaded at the time the show-invisibles plugin attaches its extra tokens. This defers attaching the extra tokens to just before highlighting, so we ensure we're able to attach to the language grammar.
PrismJS_prism
train
js
8b9c2cdac4a6d9bd7e14431eccd2e5883ee55196
diff --git a/textx/textx.py b/textx/textx.py index <HASH>..<HASH> 100644 --- a/textx/textx.py +++ b/textx/textx.py @@ -717,18 +717,7 @@ class TextXVisitor(PTNodeVisitor): .format(op, text((line, col))), line, col) # Separator modifier - if 'sep' in modifiers: - sep = modifiers['sep'] - assignment_rule = Sequence( - nodes=[rhs_rule, - ZeroOrMore( - nodes=[Sequence(nodes=[sep, rhs_rule])])], - rule_name='__asgn_list', root=True) - if op == "*=": - assignment_rule.root = False - assignment_rule = Optional(nodes=[assignment_rule], - rule_name='__asgn_list', - root=True) + assignment_rule.sep = modifiers.get('sep', None) # End of line termination modifier if 'eolterm' in modifiers:
Simplified code for separator modifiers for many assignments.
textX_textX
train
py
b874cf7e2bd993d77864815c125821e5d378f99a
diff --git a/design/apidsl/api.go b/design/apidsl/api.go index <HASH>..<HASH> 100644 --- a/design/apidsl/api.go +++ b/design/apidsl/api.go @@ -177,6 +177,8 @@ func Scheme(vals ...string) { } if a, ok := apiDefinition(false); ok { a.Schemes = append(a.Schemes, vals...) + } else if r, ok := resourceDefinition(true); ok { + r.Schemes = append(r.Schemes, vals...) } else if a, ok := actionDefinition(true); ok { a.Schemes = append(a.Schemes, vals...) } diff --git a/design/definitions.go b/design/definitions.go index <HASH>..<HASH> 100644 --- a/design/definitions.go +++ b/design/definitions.go @@ -99,6 +99,8 @@ type ( ResourceDefinition struct { // Resource name Name string + // Schemes is the supported API URL schemes + Schemes []string // Common URL prefix to all resource action HTTP requests BasePath string // Object describing each parameter that appears in BasePath if any
Make it possible for resources to have schemes
goadesign_goa
train
go,go
836c1af03057f3909da759009da7caa2a99bc7c1
diff --git a/nodeconductor/logging/middleware.py b/nodeconductor/logging/middleware.py index <HASH>..<HASH> 100644 --- a/nodeconductor/logging/middleware.py +++ b/nodeconductor/logging/middleware.py @@ -34,7 +34,7 @@ class CaptureEventContextMiddleware(object): user = getattr(request, 'user', None) if user and not user.is_anonymous(): - context.update(user._get_event_context('user')) + context.update(user._get_log_context('user')) set_event_context(context)
Fix rename (NC-<I>)
opennode_waldur-core
train
py
c74d76120743d76418f805371bf35c4b9766f6ca
diff --git a/router/router.go b/router/router.go index <HASH>..<HASH> 100644 --- a/router/router.go +++ b/router/router.go @@ -10,11 +10,17 @@ import "fmt" // Router is the basic interface of this package. type Router interface { + // AddBackend adds a new backend. + AddBackend(name string) error + + // RemoveBackend removes a backend. + RemoveBackend(name string) error + // AddRoute adds a new route. - AddRoute(name, ip string) error + AddRoute(name, address string) error //Remove removes a route. - RemoveRoute(name string) error + RemoveRoute(name, address string) error // Addr returns the route address. Addr(name string) (string, error)
router: adding AddBackend and RemoveBackend methods to router interface
tsuru_tsuru
train
go
4be7aa5bad66d5f10a8ced39fb675b54335f63d0
diff --git a/lib/discordrb/data/webhook.rb b/lib/discordrb/data/webhook.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data/webhook.rb +++ b/lib/discordrb/data/webhook.rb @@ -14,12 +14,15 @@ module Discordrb # @return [Server] the server that the webhook is currently connected to. attr_reader :server - # @return [String] the webhook's token. + # @return [String, nil] the webhook's token, if this is an Incoming Webhook. attr_reader :token # @return [String] the webhook's avatar id. attr_reader :avatar + # @return [Integer] the webhook's type (1: Incoming, 2: Channel Follower) + attr_reader :type + # Gets the user object of the creator of the webhook. May be limited to username, discriminator, # ID and avatar if the bot cannot reach the owner # @return [Member, User, nil] the user object of the owner or nil if the webhook was requested using the token. @@ -34,6 +37,7 @@ module Discordrb @server = @channel.server @token = data['token'] @avatar = data['avatar'] + @type = data['type'] # Will not exist if the data was requested through a webhook token return unless data['user']
Add Webhook#type (#<I>) Discord now features multiple types of webhooks, so update Webhook#token type signature to be nilable, because the other webhook types may not expose a token.
meew0_discordrb
train
rb
f66c5ef0acfe0837b28c46256d0506297ca06b73
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -85,7 +85,7 @@ gulp.task( "lint", function() { } ); gulp.task( "format", [ "lint" ], function() { - return gulp.src( [ "**/*.js", "!node_modules/**" ] ) + return gulp.src( [ "*.js", "{spec,src}/**/*.js" ] ) .pipe( jscs( { configPath: ".jscsrc", fix: true
Speed up gulp format by adjusting glob
LeanKit-Labs_lux.js
train
js
bc7796c4bc78ee5b9ed8df59c92061b40e50f2aa
diff --git a/lib/locomotive/steam/adapters/memory.rb b/lib/locomotive/steam/adapters/memory.rb index <HASH>..<HASH> 100644 --- a/lib/locomotive/steam/adapters/memory.rb +++ b/lib/locomotive/steam/adapters/memory.rb @@ -9,7 +9,7 @@ module Locomotive::Steam module Memory end - class MemoryAdapter < Struct.new(:collection) + MemoryAdapter = Struct.new(:collection) do include Locomotive::Steam::Adapters::Concerns::Key diff --git a/lib/locomotive/steam/middlewares/thread_safe.rb b/lib/locomotive/steam/middlewares/thread_safe.rb index <HASH>..<HASH> 100644 --- a/lib/locomotive/steam/middlewares/thread_safe.rb +++ b/lib/locomotive/steam/middlewares/thread_safe.rb @@ -1,6 +1,6 @@ module Locomotive::Steam::Middlewares - class ThreadSafe < Struct.new(:app) + ThreadSafe = Struct.new(:app) do attr_accessor :env
Another attempt to fix locomotivecms/wagon#<I> And perhaps locomotivecms/wagon#<I> as well. Moral of the story? Don't inherit from Struct: <URL>
locomotivecms_steam
train
rb,rb
67207835c474ddd44e42fedbd9987c0377aad891
diff --git a/src/dialogs/prompt-dialog.js b/src/dialogs/prompt-dialog.js index <HASH>..<HASH> 100644 --- a/src/dialogs/prompt-dialog.js +++ b/src/dialogs/prompt-dialog.js @@ -14,6 +14,7 @@ * limitations under the License. */ +const isEqual = require('lodash/isEqual'); const omit = require('lodash/omit'); const intersection = require('lodash/intersection'); const logger = require('logtown')('PromptDialog'); @@ -30,10 +31,8 @@ const doEntitiesIntersect = (entityA, entityB) => !!(intersection( ).length); const filterIntersectingEntities = (entities, entity) => { - // If there is only one entity left, do not even check if it intersects with - // other entities. - if (entities.length === 1) { - return []; + if (entity.startIndex == null || entity.endIndex == null) { + return entities.filter(e => !isEqual(e, entity)); } return entities.filter(e => !doEntitiesIntersect(e, entity));
Check for entity start & end indices instead of number of entities
Botfuel_botfuel-dialog
train
js
71aec1c3f1d6171e018021ebb20fc69aaf036f24
diff --git a/PyFunceble/dataset/db_base.py b/PyFunceble/dataset/db_base.py index <HASH>..<HASH> 100644 --- a/PyFunceble/dataset/db_base.py +++ b/PyFunceble/dataset/db_base.py @@ -91,15 +91,6 @@ class DBDatasetBase(DatasetBase): A method to be called (automatically) after __init__. """ - def __contains__(self, value: str) -> bool: - raise NotImplementedError() - - def __getattr__(self, value: Any) -> Any: - raise AttributeError(value) - - def __getitem__(self, value: Any) -> Any: - raise KeyError(value) - def execute_if_authorized(default: Any = None): # pylint: disable=no-self-argument """ Executes the decorated method only if we are authorized to process.
Deletion of unneeded methods.
funilrys_PyFunceble
train
py
f5888cfe316788b5d22c90495e47f81b82a96647
diff --git a/listing-bundle/contao/dca/tl_module.php b/listing-bundle/contao/dca/tl_module.php index <HASH>..<HASH> 100644 --- a/listing-bundle/contao/dca/tl_module.php +++ b/listing-bundle/contao/dca/tl_module.php @@ -44,7 +44,7 @@ $GLOBALS['TL_DCA']['tl_module']['fields']['list_table'] = array 'exclude' => true, 'inputType' => 'select', 'options_callback' => array('tl_module_listing', 'getAllTables'), - 'eval' => array('tl_class'=>'w50') + 'eval' => array('chosen'=>true, 'tl_class'=>'w50') ); $GLOBALS['TL_DCA']['tl_module']['fields']['list_fields'] = array
[Listing] Follow-up on #<I>
contao_contao
train
php
8ad4f1378b676df243b9c113cf0bdfac9fad314a
diff --git a/java/client/test/org/openqa/selenium/RenderedWebElementTest.java b/java/client/test/org/openqa/selenium/RenderedWebElementTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/RenderedWebElementTest.java +++ b/java/client/test/org/openqa/selenium/RenderedWebElementTest.java @@ -131,6 +131,7 @@ public class RenderedWebElementTest extends AbstractDriverTestCase { } @JavascriptEnabled + @Ignore(SELENESE) public void testCorrectlyDetectMapElementsAreShown() { driver.get(pages.mapVisibilityPage);
SimonStewart: 'fixing' the build by commenting out a test for the rendered web element that we don't expect to pass r<I>
SeleniumHQ_selenium
train
java
917b275bf2aada63581dea545c8a7942c77e08c3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -51,8 +51,6 @@ function handleFileSelect (e) { callback(null, chunk) })*/ - - readAsStream(files[0]).pipe(workerStream) } diff --git a/readAsStream.js b/readAsStream.js index <HASH>..<HASH> 100644 --- a/readAsStream.js +++ b/readAsStream.js @@ -1,13 +1,5 @@ let fileReaderStream = require('filereader-stream') -export default function readAsStream(file){ - - return fileReaderStream(file)/*.pipe(function(data){ - console.log('here', data) - })*/ - - //concat(function(contents) { - - - +export default function readAsStream (file) { + return fileReaderStream(file, {chunkSize: 9999999999}) }
refactor(): minor cleanups
usco_usco-stl-parser
train
js,js
60b2059d3b0f3054dfaa75a99fde0d73729bb0e5
diff --git a/commonjs/frontend-form/field/cards.js b/commonjs/frontend-form/field/cards.js index <HASH>..<HASH> 100644 --- a/commonjs/frontend-form/field/cards.js +++ b/commonjs/frontend-form/field/cards.js @@ -1,3 +1,4 @@ +var $ = require('jQuery'); var fieldRegistry = require('kwf/frontend-form/field-registry'); var Field = require('kwf/frontend-form/field/field'); var kwfExtend = require('kwf/extend'); @@ -6,7 +7,7 @@ var Cards = kwfExtend(Field, { initField: function() { var config = this.form.getFieldConfig(this.getFieldName()); var combobox = this.form.findField(config.combobox); - $(combobox.el.find('input.submit')).remove(); //remove non-js fallback + combobox.el.find('input.submit').remove(); //remove non-js fallback combobox.el.on('change', (function() { this.el.find('.kwfUp-kwfFormContainerCard .kwfFormCard').addClass('inactive'); this.el.find('.kwfUp-kwfFormContainerCard.kwfUp-'+combobox.getValue()+' .kwfFormCard').removeClass('inactive');
Improve field/cards.js
koala-framework_koala-framework
train
js
b70fcd24b77dceb68fc51279a3c3476a6688af07
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -61,6 +61,6 @@ setup( entry_points={'console_scripts': [ 'parsl-globus-auth=parsl.data_provider.globus:cli_run', - 'parsl-visualize=monitoring.visualization.app:cli_run', + 'parsl-visualize=parsl.monitoring.visualization.app:cli_run', ]} )
Fix typo in monitoring import Fixes #<I>.
Parsl_parsl
train
py
7e71567d50ac538f1d9867e9f4b22d60d7a3bdb7
diff --git a/ratelimit.go b/ratelimit.go index <HASH>..<HASH> 100644 --- a/ratelimit.go +++ b/ratelimit.go @@ -96,8 +96,8 @@ func (o slackOption) apply(c *config) { c.slack = int(o) } -// WithoutSlack is an Option for ratelimit.New that initializes the limiter -// without any initial tolerance for bursts of traffic. +// WithoutSlack configures the limiter to be strict and not to accumulate +// previously "unspent" requests for future bursts of traffic. var WithoutSlack Option = slackOption(0) type perOption time.Duration
Fix docstring on WithoutSlack Option (#<I>) The previous description didn't really make sense. This one hopefully does - at least in my head. Not sure if we should be adding a full description of slack, but probably not in this docstring.
uber-go_ratelimit
train
go
02359a3011fadfbd1325d2833ece4433e3989fef
diff --git a/src/TextureStore.js b/src/TextureStore.js index <HASH>..<HASH> 100644 --- a/src/TextureStore.js +++ b/src/TextureStore.js @@ -226,7 +226,7 @@ eventEmitter(TextureStoreItem); /** * Signals that a texture has been unloaded. - * @event TextureStore#textureLoad + * @event TextureStore#textureUnload * @param {Tile} tile The tile for which the texture was unloaded. */
Fix typo in TextureStore documentation.
google_marzipano
train
js
f72db16d2210b92d3af1f5fc6f602126ff5363d2
diff --git a/xtermcolor/__init__.py b/xtermcolor/__init__.py index <HASH>..<HASH> 100644 --- a/xtermcolor/__init__.py +++ b/xtermcolor/__init__.py @@ -22,6 +22,7 @@ def colorize(string, rgb=None, ansi=None,bg=None,ansi_bg=None,fd=1): #Reinitializes if fd used is different if colorize.fd != fd: colorize.init = False + colorize.fd = fd #Checks if it is on a terminal, and if the terminal is recognized if not colorize.init: @@ -42,4 +43,4 @@ def colorize(string, rgb=None, ansi=None,bg=None,ansi_bg=None,fd=1): return string colorize.init = False -colorize.fd = 1 \ No newline at end of file +colorize.fd = 1
- Ops\! Now changing file descriptor back to stdout works
broadinstitute_xtermcolor
train
py
b05e21485cea39c6706092917e0579c88fbe8a62
diff --git a/src/com/opera/core/systems/scope/DesktopWindowManagerCommand.java b/src/com/opera/core/systems/scope/DesktopWindowManagerCommand.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/scope/DesktopWindowManagerCommand.java +++ b/src/com/opera/core/systems/scope/DesktopWindowManagerCommand.java @@ -16,7 +16,6 @@ public enum DesktopWindowManagerCommand implements ICommand { LIST_WINDOWS(2), LIST_QUICK_WIDGETS(3), GET_QUICK_WIDGET(4), - //GET_STRING(5), WINDOW_SHOWN(5), // event WINDOW_UPDATED(6), // event WINDOW_CLOSED(7), // event
GetString was moved to Util service
operasoftware_operaprestodriver
train
java
ffdb0895886e720acda9a7a88d890dfc995521f9
diff --git a/src/components/MeetingPanel/i18n/en-US.js b/src/components/MeetingPanel/i18n/en-US.js index <HASH>..<HASH> 100644 --- a/src/components/MeetingPanel/i18n/en-US.js +++ b/src/components/MeetingPanel/i18n/en-US.js @@ -7,7 +7,7 @@ export default { video: 'Video', videoDescribe: 'When joining a meeting', host: 'Host', - participants: 'Participants', + participants: 'Participant', audioOptions: 'Audio Options', voIPOnly: 'VoIP Only', both: 'Both',
fix meeting participant (#<I>)
ringcentral_ringcentral-js-widgets
train
js
ff4705e3c21f44c0c295503d3d641e82f5e60a5f
diff --git a/Exedra/Container/Container.php b/Exedra/Container/Container.php index <HASH>..<HASH> 100644 --- a/Exedra/Container/Container.php +++ b/Exedra/Container/Container.php @@ -237,7 +237,7 @@ class Container implements \ArrayAccess switch($split[0]) { case 'self': - $arguments[] = $this->get($split[1]); + $arguments[] = $this->$split[1]; break; case 'services': $arguments[] = $this->get($split[1]); @@ -249,7 +249,7 @@ class Container implements \ArrayAccess $arguments[] = $this->__call($split[1]); break; default: - $arguments[] = $this->get($arg); + $arguments[] = $this->$arg; break; } }
container self resolve, directly take from property
Rosengate_exedra
train
php
9dfa69907476178b963d2487cd55c472a16aa215
diff --git a/lib/ronin/platform/cached_file.rb b/lib/ronin/platform/cached_file.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/platform/cached_file.rb +++ b/lib/ronin/platform/cached_file.rb @@ -49,6 +49,9 @@ module Ronin # The overlay the file was cached from belongs_to :overlay + # Any exceptions raise when loading a fresh object + attr_reader :cache_exception + # Any cache errors encountered when caching the object attr_reader :cache_errors @@ -128,8 +131,15 @@ module Ronin # create the fresh object object = model.new() - object.instance_eval(&block) - return object + + begin + object.instance_eval(&block) + + @cache_exception = nil + return object + rescue Exception => e + @cache_exception = e + end end end @@ -184,7 +194,6 @@ module Ronin if obj.save @cache_errors = nil - return save else @cache_errors = obj.errors
Catch any exceptions when creating the fresh object, and store them in CachedFile#cache_exception.
ronin-ruby_ronin
train
rb
0c4b69ec5a6b266e82b51504f751318266113259
diff --git a/src/ocrmypdf/pdfinfo/layout.py b/src/ocrmypdf/pdfinfo/layout.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/pdfinfo/layout.py +++ b/src/ocrmypdf/pdfinfo/layout.py @@ -212,6 +212,7 @@ class TextPositionTracker(PDFLayoutAnalyzer): super().__init__(rsrcmgr, pageno, laparams) self.textstate = None self.result = None + self.cur_item = None # not defined in pdfminer code as it should be def begin_page(self, page, ctm): super().begin_page(page, ctm)
Fix lint warning about missing cur_item
jbarlow83_OCRmyPDF
train
py
0b1f14a0e431b088fd0897bf6dac4ab3949867d0
diff --git a/lib/mystique.rb b/lib/mystique.rb index <HASH>..<HASH> 100644 --- a/lib/mystique.rb +++ b/lib/mystique.rb @@ -8,8 +8,10 @@ require "mystique/null_context" module Mystique class Presenter - self.methods.each do |m| - eval("undef #{m}") if m.to_s.start_with?("to_") + self.methods.select {|m| m.to_s.start_with?("to_") }.each do |m| + define_method(m) do |*args, &block| + target.send(m, *args, &block) + end end def initialize(object, context)
Refactored to make it compatible with Rails
iachettifederico_mystique
train
rb
494b9a67d6729ac3bd5c73b787e832e63b558b35
diff --git a/cf-client/src/main/java/cf/client/DefaultCloudController.java b/cf-client/src/main/java/cf/client/DefaultCloudController.java index <HASH>..<HASH> 100644 --- a/cf-client/src/main/java/cf/client/DefaultCloudController.java +++ b/cf-client/src/main/java/cf/client/DefaultCloudController.java @@ -832,7 +832,7 @@ public class DefaultCloudController implements CloudController { private void fetchInfo() { try { - final HttpGet get = new HttpGet(target.resolve("/info")); + final HttpGet get = new HttpGet(target.resolve("/v2/info")); // TODO Standardize on error handling // TODO Throw exception if non version 2 Cloud Controller final HttpResponse response = httpClient.execute(get);
Fetch info from v2 endpoint.
cloudfoundry-community_cf-java-component
train
java
7177af84acdddfb3e36b7982cbac982bc7a8d5d5
diff --git a/remotes/docker/pusher.go b/remotes/docker/pusher.go index <HASH>..<HASH> 100644 --- a/remotes/docker/pusher.go +++ b/remotes/docker/pusher.go @@ -339,9 +339,9 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di } // 201 is specified return status, some registries return - // 200 or 204. + // 200, 202 or 204. switch resp.StatusCode { - case http.StatusOK, http.StatusCreated, http.StatusNoContent: + case http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusAccepted: default: return errors.Errorf("unexpected status: %s", resp.Status) }
Allow <I> response code for commit Quay returns this status code when pushing
containerd_containerd
train
go
73d2bdc9430ee611e16a159781dc3cbba2e2c7a6
diff --git a/almonds.py b/almonds.py index <HASH>..<HASH> 100644 --- a/almonds.py +++ b/almonds.py @@ -361,7 +361,12 @@ def main(): colors.toggle_bright() def load(path): - import cPickle + if sys.version_info.major > 2: + import pickle + cPickle = pickle + else: + import cPickle + with open(path, "rb") as f: params = cPickle.load(f) params.log = log diff --git a/mandelbrot.py b/mandelbrot.py index <HASH>..<HASH> 100644 --- a/mandelbrot.py +++ b/mandelbrot.py @@ -78,6 +78,13 @@ def mandelbrot_capture(x, y, w, h, params): :return: Continuous number of iterations. """ + # FIXME: Figure out why these corrections are necessary or how to make them perfect + # Viewport is offset compared to window when capturing without these (found empirically) + if params.plane_ratio >= 1.0: + x -= params.plane_w + else: + x += 3.0 * params.plane_w + ratio = w / h n_x = x * 2.0 / w * ratio - 1.0 n_y = y * 2.0 / h - 1.0
more python 3 compatibility
Tenchi2xh_Almonds
train
py,py
54449386a01a8ade0c0dfbc77f0328bd0600cf1f
diff --git a/pkg/apis/kops/validation/validation.go b/pkg/apis/kops/validation/validation.go index <HASH>..<HASH> 100644 --- a/pkg/apis/kops/validation/validation.go +++ b/pkg/apis/kops/validation/validation.go @@ -99,7 +99,7 @@ func validateClusterSpec(spec *kops.ClusterSpec, fieldPath *field.Path) field.Er if spec.Networking != nil { allErrs = append(allErrs, validateNetworking(spec, spec.Networking, fieldPath.Child("networking"))...) if spec.Networking.Calico != nil { - allErrs = append(allErrs, validateNetworkingCalico(spec.Networking.Calico, spec.EtcdClusters[0], fieldPath.Child("networking").Child("calico"))...) + allErrs = append(allErrs, validateNetworkingCalico(spec.Networking.Calico, spec.EtcdClusters[0], fieldPath.Child("networking", "calico"))...) } }
Simplify chained .Child() calls
kubernetes_kops
train
go
c24c52e77f5986fcdca84499fa879a88b026f16d
diff --git a/code/DevHealthController.php b/code/DevHealthController.php index <HASH>..<HASH> 100644 --- a/code/DevHealthController.php +++ b/code/DevHealthController.php @@ -19,8 +19,7 @@ class DevHealthController extends Controller // health check does not require permission to run $checker = new EnvironmentChecker('health', 'Site health'); - $checker->init(''); - $checker->setErrorCode(404); + $checker->setErrorCode(500); return $checker; }
Allow public access to the dev/health url and change response to <I>
silverstripe_silverstripe-environmentcheck
train
php
bdcffa30127425be2ec867c1a0e809e0cb7afcec
diff --git a/lib/MongoMinify/Client.php b/lib/MongoMinify/Client.php index <HASH>..<HASH> 100644 --- a/lib/MongoMinify/Client.php +++ b/lib/MongoMinify/Client.php @@ -16,8 +16,23 @@ class Client { */ public function __construct(Array $options = array()) { + if ( ! isset($options['host'])) + { + $options['host'] = 'localhost'; + } + if ( ! isset($options['port'])) + { + $options['port'] = 27017; + } + if ( ! isset($options['db'])) + { + $options['db'] = ''; + } $this->native = new \MongoClient('mongodb://' . $options['host'] . ':' . $options['port'] . '/' . $options['db']); - $this->db = $this->selectDb($options['db']); + if ($options['db']) + { + $this->db = $this->selectDb($options['db']); + } }
Optional connection logic in the client constructor
marcqualie_mongominify
train
php
8f2739fd9fc5a79ae82cee0fc97c30ff69cf2640
diff --git a/lib/Thelia/Core/Template/Loop/Image.php b/lib/Thelia/Core/Template/Loop/Image.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Core/Template/Loop/Image.php +++ b/lib/Thelia/Core/Template/Loop/Image.php @@ -177,9 +177,11 @@ class Image extends BaseI18nLoop implements PropelSearchLoopInterface // Check for product="id" folder="id", etc. style arguments foreach ($this->possible_sources as $source) { - $argValue = intval($this->getArgValue($source)); + $argValue = $this->getArgValue($source); - if ($argValue >= 0) { + if (! empty($argValue)) { + + $argValue = intval($argValue); $search = $this->createSearchQuery($source, $argValue);
Fixed again excaption image is not found
thelia_core
train
php
d0f4a5b2b15b56c25abb0d1480be61244d9ce106
diff --git a/localshop/apps/packages/pypi.py b/localshop/apps/packages/pypi.py index <HASH>..<HASH> 100644 --- a/localshop/apps/packages/pypi.py +++ b/localshop/apps/packages/pypi.py @@ -47,16 +47,16 @@ def get_search_names(name): pyramid-debugtoolbar. """ - parts = re.split('[-_]', name) + parts = re.split('[-_.]', name) if len(parts) == 1: return parts result = set() for i in range(len(parts) - 1, 0, -1): - for s1 in '-_': + for s1 in '-_.': prefix = s1.join(parts[:i]) - for s2 in '-_': + for s2 in '-_.': suffix = s2.join(parts[i:]) - for s3 in '-_': + for s3 in '-_.': result.add(s3.join([prefix, suffix])) return list(result)
Fix the PyPi dots replacement issue
mvantellingen_localshop
train
py
d6702768707c8dc28ac01ed3aa1b74078ded403b
diff --git a/Exedra/Routing/Route.php b/Exedra/Routing/Route.php index <HASH>..<HASH> 100644 --- a/Exedra/Routing/Route.php +++ b/Exedra/Routing/Route.php @@ -690,7 +690,7 @@ class Route if($method == 'any') $method = array('get', 'post', 'put', 'delete', 'patch'); else if(!is_array($method)) - $method = explode(',', $method); + $method = explode('|', $method); $method = array_map(function($value){return trim(strtolower($value));}, $method);
Route : changed comma to wall for string based methods
Rosengate_exedra
train
php
b22f22fba2aea3b8ef0bc5ac679f3eecc4bd24ec
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,9 +15,16 @@ module.exports = { filename: "bundle.aot.js" }, + //devtool: "source-map", + plugins: [ - //new webpack.optimize.UglifyJsPlugin({}) + new webpack.optimize.UglifyJsPlugin({ + sourceMap: false, + mangle: { + except: ['testValidator'] + } + }) - ], + ] }; \ No newline at end of file
custom validator name excluded from mangling (#<I>)
udos86_ng-dynamic-forms
train
js
0df86b7f34c28f3eb6690ea32669fbae0f4595e2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -#-*- coding: utf-8 -*- +# -*- coding: utf-8 -*- from os.path import join, dirname, abspath import sys @@ -22,7 +22,7 @@ NAME = 'django-pimpmytheme' DESCRIPTION = """Customise theme (css and template) on a per user/client/whatever basis""" REQUIREMENTS = [ - 'django', + 'django<1.7', 'django-compressor', ] __VERSION__ = read_relative_file('VERSION').strip()
freezed the django requirement
peopledoc_django-pimpmytheme
train
py
336fdec315912a407c38ea962dac50fb081b157f
diff --git a/benchmark/cases/shadowsocks/stream-cipher.bench.js b/benchmark/cases/shadowsocks/stream-cipher.bench.js index <HASH>..<HASH> 100644 --- a/benchmark/cases/shadowsocks/stream-cipher.bench.js +++ b/benchmark/cases/shadowsocks/stream-cipher.bench.js @@ -23,6 +23,9 @@ module.exports = function main() { 'aes-128-ctr': compile('aes-128-ctr'), 'aes-192-ctr': compile('aes-192-ctr'), 'aes-256-ctr': compile('aes-256-ctr'), + 'aes-128-cfb': compile('aes-128-cfb'), + 'aes-192-cfb': compile('aes-192-cfb'), + 'aes-256-cfb': compile('aes-256-cfb'), 'rc4-md5': compile('rc4-md5'), 'rc4-md5-6': compile('rc4-md5-6'), 'chacha20-ietf': compile('chacha20-ietf'),
benchmark: add tests for AES-CFB mode
blinksocks_blinksocks
train
js
0f90be88253650f760a2539da874a94bca47b81d
diff --git a/marrow/util/compat.py b/marrow/util/compat.py index <HASH>..<HASH> 100644 --- a/marrow/util/compat.py +++ b/marrow/util/compat.py @@ -35,7 +35,7 @@ try: range = xrange except: - pass + range = range # Reimplementation of execfile for Python 3.
Forgot to re-define range to include it in the local scope.
marrow_util
train
py
2bb8bd09fdd8e32a83194c9ae92f2205b39e77b6
diff --git a/esridump/dumper.py b/esridump/dumper.py index <HASH>..<HASH> 100644 --- a/esridump/dumper.py +++ b/esridump/dumper.py @@ -432,7 +432,7 @@ class EsriDumper(object): # pause every number of "requests_to_pause", that increase the probability for server response if query_index % self._requests_to_pause == 0: time.sleep(self._pause_seconds) - self._logger.info("pause for {0} seconds".format(self._pause_seconds)) + self._logger.info("pause for %s seconds", self._pause_seconds) response = self._request('POST', query_url, headers=headers, data=query_args) data = self._handle_esri_errors(response, "Could not retrieve this chunk of objects") # reset the exception state.
Update esridump/dumper.py
openaddresses_pyesridump
train
py
9ef4e766a3cf02c87acfefad26e17a7a75c30ed2
diff --git a/loaderEdgeList.php b/loaderEdgeList.php index <HASH>..<HASH> 100644 --- a/loaderEdgeList.php +++ b/loaderEdgeList.php @@ -35,7 +35,7 @@ class LoaderEdgeList implements Loader{ // add edge to graph $graph->addEdge($edge); // add edge to vertice - $vertexArray[$array[0]]->addEdge($edge); + $vertexArray[$array[0]]->addEdge($edgeCounter); echo "added edge nr {$edgeCounter} from {$array[0]} to {$array[1]}\n"; $edgeCounter++;
updated loader to set the id instead of the refferenze
graphp_graph
train
php
3c2ec18de8bf716647079e0b680f417a97675397
diff --git a/molgenis-integration-tests/src/test/java/org/molgenis/integrationtest/data/abstracts/query/AbstractQueryIT.java b/molgenis-integration-tests/src/test/java/org/molgenis/integrationtest/data/abstracts/query/AbstractQueryIT.java index <HASH>..<HASH> 100644 --- a/molgenis-integration-tests/src/test/java/org/molgenis/integrationtest/data/abstracts/query/AbstractQueryIT.java +++ b/molgenis-integration-tests/src/test/java/org/molgenis/integrationtest/data/abstracts/query/AbstractQueryIT.java @@ -73,6 +73,7 @@ public abstract class AbstractQueryIT extends AbstractDataIntegrationIT testString(); testDate(); testDateTime(); + testBool(); testXref(); testMref(); }
Added boolean to tested methods
molgenis_molgenis
train
java
34b5b29253566ec0809eaca5d7fae1609237eb72
diff --git a/tools/eclipslee/plugin/plugins/org.mobicents.eclipslee.servicecreation/src/org/mobicents/eclipslee/servicecreation/ui/SbbEventConfigDialog.java b/tools/eclipslee/plugin/plugins/org.mobicents.eclipslee.servicecreation/src/org/mobicents/eclipslee/servicecreation/ui/SbbEventConfigDialog.java index <HASH>..<HASH> 100644 --- a/tools/eclipslee/plugin/plugins/org.mobicents.eclipslee.servicecreation/src/org/mobicents/eclipslee/servicecreation/ui/SbbEventConfigDialog.java +++ b/tools/eclipslee/plugin/plugins/org.mobicents.eclipslee.servicecreation/src/org/mobicents/eclipslee/servicecreation/ui/SbbEventConfigDialog.java @@ -89,7 +89,7 @@ public class SbbEventConfigDialog extends Dialog implements ModifyListener, Sele label = new Label(topComp, SWT.NONE); label.setText("&Event Direction:"); - directionCombo = new Combo(topComp, SWT.DROP_DOWN); + directionCombo = new Combo(topComp, SWT.DROP_DOWN | SWT.READ_ONLY); directionCombo.setItems(EVENT_DIRECTIONS); directionCombo.addModifyListener(this); directionCombo.addSelectionListener(this);
EclipSLEE: Making Event Direction Combo as read-only. git-svn-id: <URL>
RestComm_jain-slee
train
java
f60953435a06d06a172676580df277d6984cc775
diff --git a/stripe.go b/stripe.go index <HASH>..<HASH> 100644 --- a/stripe.go +++ b/stripe.go @@ -817,7 +817,7 @@ func StringValue(v *string) string { const apiURL = "https://api.stripe.com" // apiversion is the currently supported API version -const apiversion = "2019-02-11" +const apiversion = "2019-02-19" // clientversion is the binding version const clientversion = "57.0.0"
Fix API version which should be pinned to <I>-<I>-<I> instead
stripe_stripe-go
train
go
369813fb67dcca888946454b9c3819ff054b52ac
diff --git a/Facades/Broadcast.php b/Facades/Broadcast.php index <HASH>..<HASH> 100644 --- a/Facades/Broadcast.php +++ b/Facades/Broadcast.php @@ -6,10 +6,11 @@ use Illuminate\Contracts\Broadcasting\Factory as BroadcastingFactoryContract; /** * @method static \Illuminate\Broadcasting\Broadcasters\Broadcaster channel(string $channel, callable|string $callback, array $options = []) - * @method static mixed auth(\Illuminate\Http\Request $request) + * @method static \Illuminate\Broadcasting\BroadcastManager socket($request = null) * @method static \Illuminate\Contracts\Broadcasting\Broadcaster connection($name = null); + * @method static mixed auth(\Illuminate\Http\Request $request) + * @method static void resolveAuthenticatedUserUsing(Closure $callback) * @method static void routes(array $attributes = null) - * @method static \Illuminate\Broadcasting\BroadcastManager socket($request = null) * * @see \Illuminate\Contracts\Broadcasting\Factory */
[9.x] User authentication for Pusher (#<I>) * Added /broadcasting/user-auth * Added typehint * csfixing * formatting * change wording * formatting
illuminate_support
train
php
118da30c1ba6e7a35db548781478edbd5b2fbc4e
diff --git a/swingtix/settings.py b/swingtix/settings.py index <HASH>..<HASH> 100644 --- a/swingtix/settings.py +++ b/swingtix/settings.py @@ -152,3 +152,5 @@ LOGGING = { }, } } + +TEST_RUNNER = 'django.test.runner.DiscoverRunner'
Resolution of SwingTix/bookkeeper#7 Introduced the TEST_RUNNER property to settings.py
SwingTix_bookkeeper
train
py
525b60125348bc2d3a11befeef037f1c1393442f
diff --git a/src/blocks/scratch3_operators.js b/src/blocks/scratch3_operators.js index <HASH>..<HASH> 100644 --- a/src/blocks/scratch3_operators.js +++ b/src/blocks/scratch3_operators.js @@ -85,7 +85,7 @@ class Scratch3OperatorsBlocks { if (low === high) return low; // If both arguments are ints, truncate the result to an int. if (Cast.isInt(args.FROM) && Cast.isInt(args.TO)) { - return low + parseInt(Math.random() * ((high + 1) - low), 10); + return low + Math.floor(Math.random() * ((high + 1) - low)); } return (Math.random() * (high - low)) + low; } @@ -107,7 +107,7 @@ class Scratch3OperatorsBlocks { length (args) { return Cast.toString(args.STRING).length; } - + contains (args) { const format = function (string) { return Cast.toString(string).toLowerCase();
Switch from parseInt to Math.floor
LLK_scratch-vm
train
js
363e2d02a579b924819c070787f82e0f7fb450b9
diff --git a/cli/src/cmd/init.js b/cli/src/cmd/init.js index <HASH>..<HASH> 100644 --- a/cli/src/cmd/init.js +++ b/cli/src/cmd/init.js @@ -119,7 +119,7 @@ export let init = { } if (!pkg.dependencies.silk) { - pkg.dependencies.silk = '^0.17.0'; + pkg.dependencies.silk = '^1.0.0'; } await fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2));
Bump minimum silk version to <I>
silklabs_silk
train
js
20548e6fa072e9555bfaae38a9d9df19aca4bd32
diff --git a/threads/views.py b/threads/views.py index <HASH>..<HASH> 100755 --- a/threads/views.py +++ b/threads/views.py @@ -12,10 +12,11 @@ from django.template import RequestContext from farnsworth.settings import house, ADMINS, max_threads, max_messages, time_formats from django.contrib.auth import logout, login, authenticate, hashers from models import UserProfile, Thread, Message -from requests.models import RequestType +from requests.models import RequestType, Manager, Request, Announcement from events.models import Event from django.contrib.auth.models import User import datetime +from django.utils.timezone import utc def red_ext(request, message=None): ''' @@ -102,7 +103,7 @@ def homepage_view(request, message=None): events_list = Event.objects.filter(start_time__year=today.year, start_time__month=today.month, start_time__day=today.day) events_dict = list() # Pseudo-dictionary, list with items of form (event, ongoing, rsvpd, rsvp_form) for event in events_list: - form = RsvpForm(initial={'event_pk': event_pk}) + form = RsvpForm(initial={'event_pk': event.pk}) form.fields['event_pk'].widget = forms.HiddenInput() ongoing = ((event.start_time <= now) and (event.end_time >= now)) rsvpd = (userProfile in event.rsvps.all())
fixed import errors in threads.view
knagra_farnsworth
train
py
b8f893e4b42063c14090cb221eb888c0671a644a
diff --git a/packages/numeric-input/src/NumericInput.js b/packages/numeric-input/src/NumericInput.js index <HASH>..<HASH> 100644 --- a/packages/numeric-input/src/NumericInput.js +++ b/packages/numeric-input/src/NumericInput.js @@ -35,7 +35,11 @@ export default class NumericInput extends Component { /** * Fired when an element has received focus */ - onFocus: PropTypes.func + onFocus: PropTypes.func, + /** + * Initial value to display + */ + defaultValue: PropTypes.number }; static defaultProps = { @@ -50,10 +54,11 @@ export default class NumericInput extends Component { onChange, onBlur, onFocus, + defaultValue, ...otherProps } = this.props; - const { className, disabled, step, value, defaultValue } = otherProps; + const { className, disabled, step, value} = otherProps; const inputClassName = createCustomClassNames(className, "input");
refactor: resolve react test failing
Autodesk_hig
train
js
ddd4264fc8c6814ea065fe8696d278f7852d47ef
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -429,6 +429,8 @@ func (c *client) reconnect() { go alllogic(c) go outgoing(c) go incoming(c) + + c.resume(false) } // This function is only used for receiving a connack
Resending qos packages after reconnecting resolves #<I>
eclipse_paho.mqtt.golang
train
go
bf8ef70b4f6e5766d9d685c4a98b63f778e5c180
diff --git a/Tests/Unit/Task/BaseTaskTest.php b/Tests/Unit/Task/BaseTaskTest.php index <HASH>..<HASH> 100644 --- a/Tests/Unit/Task/BaseTaskTest.php +++ b/Tests/Unit/Task/BaseTaskTest.php @@ -14,7 +14,7 @@ namespace TYPO3\Surf\Tests\Unit\Task; /** * Base unit test for tasks */ -class BaseTaskTest extends \TYPO3\FLOW3\Tests\UnitTestCase { +abstract class BaseTaskTest extends \TYPO3\FLOW3\Tests\UnitTestCase { /** * Executed commands
[TASK] Make class BaseTaskTest abstract The unit test base class should be abstract to prevent warnings from PHPUnit. Change-Id: I<I>e3fabac7c<I>bd<I>d<I>b3d7f<I>bc
TYPO3_Surf
train
php
bbdc3355d7af9a9f6b8af54356e8b63ecc08c858
diff --git a/lib/celluloid.rb b/lib/celluloid.rb index <HASH>..<HASH> 100644 --- a/lib/celluloid.rb +++ b/lib/celluloid.rb @@ -449,10 +449,10 @@ module Celluloid end # Timeout on task suspension (eg Sync calls to other actors) - def timeout(duration, &block) + def timeout(duration) task = Task.current timer = after(duration) { task.resume TimeoutError.new } - block.call + yield ensure timer.cancel if timer end
Don't bother naming a block if we're not passing it anywhere
celluloid_celluloid
train
rb
23a97d83e8799c8d6bd3385679fcca5a5c46eb07
diff --git a/admin/settings.php b/admin/settings.php index <HASH>..<HASH> 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -78,7 +78,8 @@ if ($data = data_submitted()) { } else { error(get_string('confirmsesskeybad', 'error')); } - //update $COURSE to match changed $SITE + // now update $SITE - it might have been changed + $SITE = get_record('course', 'id', $SITE->id); $COURSE = clone($SITE); } diff --git a/lib/adminlib.php b/lib/adminlib.php index <HASH>..<HASH> 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -1693,10 +1693,7 @@ class admin_setting_sitesettext extends admin_setting_configtext { $record->id = $this->id; $record->{$this->name} = $data; $record->timemodified = time(); - $status = update_record('course', $record) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />'; - //now update $SITE - global $SITE; - $SITE = get_record('course', 'id', $SITE->id); + return (update_record('course', $record) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />'); } }
reverting moved $SITE reinitialisation into setting method, it was not a good idea after all; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php,php
6eca3272dc6930a620a64302682fb6c29809d537
diff --git a/bees/huebee/huebeefactory.go b/bees/huebee/huebeefactory.go index <HASH>..<HASH> 100644 --- a/bees/huebee/huebeefactory.go +++ b/bees/huebee/huebeefactory.go @@ -70,7 +70,7 @@ func (factory *HueBeeFactory) Options() []bees.BeeOptionDescriptor { { Name: "address", Description: "Address of the Hue bridge, eg: 192.168.0.1", - Type: "url", + Type: "address", Mandatory: true, }, {
Hue's bridge IP is an address, not a URL
muesli_beehive
train
go
67c1f090d3fd1f3710fce2c42cd61460a4b8682c
diff --git a/src/plotypus/lightcurve.py b/src/plotypus/lightcurve.py index <HASH>..<HASH> 100644 --- a/src/plotypus/lightcurve.py +++ b/src/plotypus/lightcurve.py @@ -147,8 +147,11 @@ def get_lightcurve(data, period=None, cv=scoring_cv, scoring='mean_squared_error').mean() - return _period, lc, data, coefficients, R2, MSE, \ - arg_max_light/len(phases), sem(lc) + t_max = arg_max_light/len(phases) + dA_0 = sem(lc) + + return _period, lc, data, coefficients, R2, MSE, t_max, dA_0 + def get_lightcurve_from_file(filename, *args, use_cols=range(3), **kwargs): data = numpy.ma.array(data=numpy.loadtxt(filename, usecols=use_cols),
Wrote the return values of `lightcurve.get_lightcurve` in a slightly more readable way.
astroswego_plotypus
train
py
82a7c951b0cd7da8f15c8884b4140c7e5b6c4e6f
diff --git a/src/eventify.js b/src/eventify.js index <HASH>..<HASH> 100644 --- a/src/eventify.js +++ b/src/eventify.js @@ -21,9 +21,6 @@ module.exports = eventify; * * @option promises: 'resolve' or 'ignore', default is 'resolve'. * - * @option poll: Promise resolution polling period in milliseconds, - * default is 1000. - * * @option dates: 'toJSON' or 'ignore', default is 'toJSON'. * * @option maps: 'object', or 'ignore', default is 'object'. @@ -47,7 +44,6 @@ function eventify (data, options) { function normaliseOptions () { options = options || {}; - options.poll = options.poll || 1000; normaliseOption('promises'); normaliseOption('dates');
Remove stale poll option stuff.
philbooth_bfj
train
js
9b2953458db3b1eb088b334ee0ef050c06c93f41
diff --git a/lib/ability.rb b/lib/ability.rb index <HASH>..<HASH> 100644 --- a/lib/ability.rb +++ b/lib/ability.rb @@ -37,7 +37,8 @@ class Ability if @user # Add the base user abilities. - append_abilities ability_key(@user.class.name) if @user.class.name + user_class_name = String(@user.class.name) + append_abilities ability_key(user_class_name) unless user_class_name.empty? else # If user not set then lets create a guest @user = Object.new
Fixes <I> sending empty string to Ability#ability_key.
james2m_canard
train
rb
f98c30e374b680bc5dde1fa717ec724cc309e20b
diff --git a/components/response_wrapper.js b/components/response_wrapper.js index <HASH>..<HASH> 100644 --- a/components/response_wrapper.js +++ b/components/response_wrapper.js @@ -57,19 +57,6 @@ Response.prototype.logger = function (logger) { }; /** - * [renderer description] - * @param {[type]} renderer [description] - * @return {[type]} - */ -Response.prototype.renderer = function (renderer) { - if (typeof renderer != "undefined") { - this._renderer = renderer; - } - - return this._renderer; -}; - -/** * * @param type */
remove renderer functionality, moving a different direction
Dashron_roads
train
js
bd73c878087b02149a2d7d33d1d793065c239d99
diff --git a/src/libs/eventhandler.js b/src/libs/eventhandler.js index <HASH>..<HASH> 100644 --- a/src/libs/eventhandler.js +++ b/src/libs/eventhandler.js @@ -6,12 +6,6 @@ export default class Eventhandler { } /** - * Checks the type of given var - * @type {Function} - */ - classof = Object.classof; - - /** * Passed config object * @type {Object} */
Eventhandler: removed unused method
SerkanSipahi_app-decorators
train
js
20c391fa583f25f758a02d06a53bf603912408ec
diff --git a/abilian/web/forms/validators.py b/abilian/web/forms/validators.py index <HASH>..<HASH> 100644 --- a/abilian/web/forms/validators.py +++ b/abilian/web/forms/validators.py @@ -217,9 +217,14 @@ def siret_validator(): """ - def _validate_siret(form, field): - """ SIRET validator. """ - siret = (field.data or u'').strip() + def _validate_siret(form, field, siret=""): + """SIRET validator. A WTForm validator wants a form and a field as + parameters. We also want to give directly a siret, for a + scripting use. + + """ + if field is not None: + siret = (field.data or u'').strip() if len(siret) != 14: raise ValidationError(_(u'SIRET must have exactly 14 characters ({count})'
siret validator: also give the siret as str, not form field for scripts
abilian_abilian-core
train
py
b2f0943710ea9aaedde1bbe490f1cb67f13c49d1
diff --git a/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php b/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php +++ b/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php @@ -29,8 +29,8 @@ class ManagerRegistryTest extends DoctrineTestCase { $this->mr = new TestManagerRegistry( 'ORM', - array('default' => 'default_connection'), - array('default' => 'default_manager'), + ['default' => 'default_connection'], + ['default' => 'default_manager'], 'default', 'default', ObjectManagerAware::class, @@ -81,7 +81,7 @@ class ManagerRegistryTest extends DoctrineTestCase private function getManagerFactory() { return function () { - $mock = $this->getMockBuilder(ObjectManager::class)->getMock(); + $mock = $this->createMock(ObjectManager::class); $driver = $this->createMock(MappingDriver::class); $metadata = $this->createMock(ClassMetadata::class); $mock->method('getMetadataFactory')->willReturn(new TestClassMetadataFactory($driver, $metadata));
Minor CS changes in the `ManagerRegistryTest` as per #<I>
doctrine_common
train
php
dfd6b063ae4a6ba29d0b55928b95f1642868c806
diff --git a/src/bosh-director/spec/spec_helper.rb b/src/bosh-director/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/src/bosh-director/spec/spec_helper.rb +++ b/src/bosh-director/spec/spec_helper.rb @@ -9,6 +9,7 @@ require 'pg' require 'tempfile' require 'tmpdir' require 'zlib' +require 'timecop' require 'archive/tar/minitar' require 'machinist/sequel'
Require timecop in the spec helper
cloudfoundry_bosh
train
rb
e392fe55aecb83414fa6d4d261d499e807b4347f
diff --git a/core/server/apps/private-blogging/lib/middleware.js b/core/server/apps/private-blogging/lib/middleware.js index <HASH>..<HASH> 100644 --- a/core/server/apps/private-blogging/lib/middleware.js +++ b/core/server/apps/private-blogging/lib/middleware.js @@ -22,7 +22,7 @@ function verifySessionHash(salt, hash) { } function getRedirectUrl(query) { - const redirect = decodeURIComponent(query ? query.r : '/'); + const redirect = decodeURIComponent(query.r || '/'); try { return new url.URL(redirect, urlService.utils.urlFor('home', true)).pathname; } catch (e) { diff --git a/core/test/unit/apps/private-blogging/middleware_spec.js b/core/test/unit/apps/private-blogging/middleware_spec.js index <HASH>..<HASH> 100644 --- a/core/test/unit/apps/private-blogging/middleware_spec.js +++ b/core/test/unit/apps/private-blogging/middleware_spec.js @@ -25,7 +25,9 @@ describe('Private Blogging', function () { var req, res, next; beforeEach(function () { - req = {}; + req = { + query: {} + }; res = {}; settingsStub = sandbox.stub(settingsCache, 'get'); next = sandbox.spy();
:bug: Fixed redirect issue with private sites (#<I>) closes #<I> This issue existed because the logic assumed that if there were no query parameters then there would be no `query` object. However this is not the case. What we really wanted to check was for the existence of an "r" query param - the code has been refactor to explicitly do this now.
TryGhost_Ghost
train
js,js
44890bd73807f359e86af905c9b9158d535eead1
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,11 +29,11 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2018120301.02; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2018120301.03; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '3.7dev (Build: 20181205)'; // Human-friendly version name +$release = '3.7dev (Build: 20181210)'; // Human-friendly version name $branch = '37'; // This version's branch. $maturity = MATURITY_ALPHA; // This version's maturity level.
weekly on-sync release <I>dev
moodle_moodle
train
php
9169d31f964d534c4c0a252adf61c67094f7ce38
diff --git a/aioconsole/rlwrap.py b/aioconsole/rlwrap.py index <HASH>..<HASH> 100644 --- a/aioconsole/rlwrap.py +++ b/aioconsole/rlwrap.py @@ -61,9 +61,9 @@ def _rlwrap(process, use_stderr=False, return process.returncode -def bind(src, dest, value=True): +def bind(src, dest, value=True, buffersize=4096): while value: - value = src.read(1) + value = src.read(buffersize) dest.write(value) dest.flush()
Use a larger buffersize for stdout binding
vxgmichel_aioconsole
train
py
2215702ae87b2d41d9b1c9ba80ca93fa11049412
diff --git a/gns3server/compute/base_node.py b/gns3server/compute/base_node.py index <HASH>..<HASH> 100644 --- a/gns3server/compute/base_node.py +++ b/gns3server/compute/base_node.py @@ -527,7 +527,7 @@ class BaseNode: """ if self.ubridge_path is None: - raise NodeError("uBridge is not available or path doesn't exist") + raise NodeError("uBridge is not available or path doesn't exist. Or you just install GNS3 and need to restart your user session to refresh user permissions.") if not self._manager.has_privileged_access(self.ubridge_path): raise NodeError("uBridge requires root access or capability to interact with network adapters")
Ask user to refresh is user session if he just installed ubridge Ref <URL>
GNS3_gns3-server
train
py
1aac684cdeef754915315bc11b2386f52bd2726d
diff --git a/lib/neo4j/event_handler.rb b/lib/neo4j/event_handler.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j/event_handler.rb +++ b/lib/neo4j/event_handler.rb @@ -201,7 +201,11 @@ module Neo4j end def property_changed(node, key, old_value, new_value) - @listeners.each {|li| li.on_property_changed(node, key, old_value, new_value) if li.respond_to?(:on_property_changed)} + @listeners.each do |li| + if li.respond_to?(:on_property_changed) && key != '_classname' + li.on_property_changed(node, key, old_value, new_value) + end + end end def rel_property_changed(rel, key, old_value, new_value)
Avoiding property_change notification for _classname
neo4jrb_neo4j
train
rb
3a565d280ae98a3be0ba095eced59062cd7b937b
diff --git a/salt/states/dockerng.py b/salt/states/dockerng.py index <HASH>..<HASH> 100644 --- a/salt/states/dockerng.py +++ b/salt/states/dockerng.py @@ -1580,6 +1580,13 @@ def running(name, image = ':'.join(_get_repo_tag(str(image))) if image not in __salt__['dockerng.list_tags'](): + if __opts__['test']: + ret['result'] = None + ret['comment'] = ( + 'Image {} will be pulled and container {} will be created' + .format(image, name) + ) + return ret try: # Pull image pull_result = __salt__['dockerng.pull'](
don't pull image in dockerng.running if test=true
saltstack_salt
train
py
227fa161a775b8d750792685d2ff3193352c66e2
diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java +++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java @@ -17157,7 +17157,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { * @since 1.5.0 */ public static int findIndexOf(Object self, int startIndex, Closure condition) { - return findIndexOf(InvokerHelper.asIterator(self), condition); + return findIndexOf(InvokerHelper.asIterator(self), startIndex, condition); } /**
GROOVY-<I>: fix missing reference to startIndex in DefaultGroovyMethod#findIndexOf(Object self, int startIndex, Closure condition) (closes #<I>) Bug: can't use startIndex
apache_groovy
train
java
d9a917646526a352b29b2298b4ff6f089fc973cb
diff --git a/lib/depject/sheet/display.js b/lib/depject/sheet/display.js index <HASH>..<HASH> 100644 --- a/lib/depject/sheet/display.js +++ b/lib/depject/sheet/display.js @@ -5,9 +5,13 @@ exports.gives = nest('sheet.display') exports.create = function () { return nest('sheet.display', function (handler) { - const { content, footer, classList, onMount } = handler(done) + const { content, footer, classList, onMount, attributes } = handler(done) - const container = h('div', { className: 'Sheet', classList }, [ + let fullAttributes = { className: 'Sheet', classList } + if (attributes !== undefined) { + fullAttributes = { ...attributes, ...fullAttributes } + } + const container = h('div', fullAttributes, [ h('section', [content]), h('footer', [footer]) ])
Allow setting arbitrary attributes on display sheets. This can be used to e.g. set event handlers or such for the faux-modals we use for confirmation dialogs and such.
ssbc_patchwork
train
js
60cbae02113e82544ddfdefa1af832e07703350a
diff --git a/lib/dm-core.rb b/lib/dm-core.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core.rb +++ b/lib/dm-core.rb @@ -171,7 +171,7 @@ module DataMapper # @demo spec/integration/repository_spec.rb def self.repository(name = nil) # :yields: current_context current_repository = if name - raise ArgumentError, "First optional argument must be a Symbol, but was #{args.first.inspect}" unless name.is_a?(Symbol) + raise ArgumentError, "First optional argument must be a Symbol, but was #{name.inspect}" unless name.is_a?(Symbol) Repository.context.detect { |r| r.name == name } || Repository.new(name) else Repository.context.last || Repository.new(Repository.default_name)
Renamed unused variable in exception string
datamapper_dm-core
train
rb