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
51c31cb92a95e323f8be65f1ff3bac465c5aab04
diff --git a/lib/bitcoin/sighash_generator.rb b/lib/bitcoin/sighash_generator.rb index <HASH>..<HASH> 100644 --- a/lib/bitcoin/sighash_generator.rb +++ b/lib/bitcoin/sighash_generator.rb @@ -71,7 +71,9 @@ module Bitcoin amount = [amount].pack('Q') nsequence = [tx.inputs[input_index].sequence].pack('V') hash_outputs = Bitcoin.double_sha256(tx.outputs.map{|o|o.to_payload}.join) - + if output_script.p2wsh? + warn('The output_script must be a witness script, not the P2WSH itself.') + end script_code = output_script.to_script_code(skip_separator_index) case (hash_type & 0x1f)
Add waring to Tx#sighash_for_input when P2WSH output_script are specified In P2WSH case, it should pass witness script instead of scriptPubkey. Add a warning message to make you aware of this mistake.
chaintope_bitcoinrb
train
rb
01a60a9ac25373c4b6db318ecc40abe0db8e3f64
diff --git a/lib/http/2/emitter.rb b/lib/http/2/emitter.rb index <HASH>..<HASH> 100644 --- a/lib/http/2/emitter.rb +++ b/lib/http/2/emitter.rb @@ -20,8 +20,8 @@ module HTTP2 # @param event [Symbol] # @param block [Proc] callback function def once(event, &block) - add_listener(event) do |*args| - block.call(*args) + add_listener(event) do |*args, &callback| + block.call(*args, &callback) :delete end end diff --git a/spec/emitter_spec.rb b/spec/emitter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/emitter_spec.rb +++ b/spec/emitter_spec.rb @@ -31,6 +31,14 @@ describe HTTP2::Emitter do args.should eq 123 end + it "should pass emitted callbacks to listeners" do + @w.on(:a) { |&block| block.call } + @w.once(:a) { |&block| block.call } + @w.emit(:a) { @cnt += 1 } + + @cnt.should eq 2 + end + it "should allow events with no callbacks" do expect { @w.emit(:missing) }.to_not raise_error end
Update 'once' listeners to accept a block argument One-time listeners now accept an emitted callback to match the behavior of persistent listeners.
igrigorik_http-2
train
rb,rb
ead8fdd1659f743a060679d77ec94deaa7ac92a0
diff --git a/NewIntegrationTest.py b/NewIntegrationTest.py index <HASH>..<HASH> 100644 --- a/NewIntegrationTest.py +++ b/NewIntegrationTest.py @@ -198,7 +198,7 @@ if len( sys.argv ) > 1 and sys.argv[ 1 ] == "--record": class_, method = method.split( "." ) method = "test" + method print "Recording method", method, "of class", class_ - exec "testCase = " + class_ + "( methodName = method )" + testCase = eval( class_ )( methodName = method ) method = getattr( testCase, method ) TestCase.setUp = TestCase.setUpForRecord TestCase.tearDown = TestCase.tearDownForRecord
Use a small eval instead of a big exec
PyGithub_PyGithub
train
py
1ec1816d7c76ae079ad3b3e3b7a1bae70e0dd95b
diff --git a/gitlab/utils.py b/gitlab/utils.py index <HASH>..<HASH> 100644 --- a/gitlab/utils.py +++ b/gitlab/utils.py @@ -55,3 +55,7 @@ def sanitized_url(url): parsed = urlparse(url) new_path = parsed.path.replace(".", "%2E") return parsed._replace(path=new_path).geturl() + + +def remove_none_from_dict(data): + return {k: v for k, v in data.items() if v is not None} diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index <HASH>..<HASH> 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -760,6 +760,7 @@ class FeatureManager(ListMixin, DeleteMixin, RESTManager): "group": group, "project": project, } + data = utils.remove_none_from_dict(data) server_data = self.gitlab.http_post(path, post_data=data, **kwargs) return self._obj_cls(self, server_data)
fix: remove null values from features POST data, because it fails with HTTP <I>
python-gitlab_python-gitlab
train
py,py
8c1fd78713ea0f2afc5e245d1a218d4496fde81e
diff --git a/src/main/java/org/primefaces/component/api/UIData.java b/src/main/java/org/primefaces/component/api/UIData.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/primefaces/component/api/UIData.java +++ b/src/main/java/org/primefaces/component/api/UIData.java @@ -150,13 +150,13 @@ public class UIData extends javax.faces.component.UIData { } public void calculateFirst() { - int rows = this.getRowsToRender(); + int rows = this.getRows(); if(rows > 0) { int first = this.getFirst(); int rowCount = this.getRowCount(); - if(first >= rowCount) { + if(rowCount > 0 && first >= rowCount) { int numberOfPages = (int) Math.ceil(rowCount * 1d / rows); this.setFirst((numberOfPages-1) * rows);
Fixed negative first in case rowCount is 0.
primefaces_primefaces
train
java
344431cdd48ec19b73fdc5d36f056eb7bee5154b
diff --git a/rootfs/diff.go b/rootfs/diff.go index <HASH>..<HASH> 100644 --- a/rootfs/diff.go +++ b/rootfs/diff.go @@ -44,7 +44,7 @@ func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter return ocispec.Descriptor{}, err } - lowerKey := fmt.Sprintf("%s-parent-view", info.Parent) + lowerKey := fmt.Sprintf("%s-parent-view-%s", info.Parent, uniquePart()) lower, err := sn.View(ctx, lowerKey, info.Parent) if err != nil { return ocispec.Descriptor{}, err @@ -58,7 +58,7 @@ func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter return ocispec.Descriptor{}, err } } else { - upperKey := fmt.Sprintf("%s-view", snapshotID) + upperKey := fmt.Sprintf("%s-view-%s", snapshotID, uniquePart()) upper, err = sn.View(ctx, upperKey, snapshotID) if err != nil { return ocispec.Descriptor{}, err
fix: support simultaneous create diff for same parent snapshot
containerd_containerd
train
go
eea79a902f2a53585f409eb25209166dc70bc028
diff --git a/app/mailers/camaleon_cms/html_mailer.rb b/app/mailers/camaleon_cms/html_mailer.rb index <HASH>..<HASH> 100644 --- a/app/mailers/camaleon_cms/html_mailer.rb +++ b/app/mailers/camaleon_cms/html_mailer.rb @@ -16,8 +16,8 @@ class CamaleonCms::HtmlMailer < ActionMailer::Base # content='', from=nil, attachs=[], url_base='', current_site, template_name, layout_name, extra_data, format, cc_to def sender(email, subject='Hello', data = {}) - data[:current_site] = CamaleonCms::Site.main_site unless data[:current_site].present? - data[:current_site] = CamaleonCms::Site.find(data[:current_site]) if data[:current_site].is_a?(Integer) + data[:current_site] = CamaleonCms::Site.main_site.decorate unless data[:current_site].present? + data[:current_site] = CamaleonCms::Site.find(data[:current_site]).decorate if data[:current_site].is_a?(Integer) @current_site = data[:current_site] current_site = data[:current_site] data = {cc_to: [], from: current_site.get_option("email")}.merge(data)
send_mail added support for background jobs (sidekiq or similar)
owen2345_camaleon-cms
train
rb
38f177c27303b33968ba207c1e6d00074624ad25
diff --git a/lib/ravel.js b/lib/ravel.js index <HASH>..<HASH> 100644 --- a/lib/ravel.js +++ b/lib/ravel.js @@ -99,6 +99,7 @@ class Ravel extends AsyncEventEmitter { this.registerParameter('session max age', true, null); this.registerParameter('session secure', true, true); this.registerParameter('session rolling', true, false); + this.registerParameter('session samesite', true, null); // Passport parameters this.registerParameter('app route', false, '/'); this.registerParameter('login route', false, '/login'); @@ -275,9 +276,10 @@ class Ravel extends AsyncEventEmitter { httpOnly: true, /* (boolean) httpOnly or not (default true) */ signed: true, /* (boolean) signed or not (default true) */ secure: this.get('https') || this.get('session secure'), /* (boolean) secure or not (default true) */ - rolling: this.get('session rolling') /* (boolean) Force a session identifier cookie to be set on every response. + rolling: this.get('session rolling'), /* (boolean) Force a session identifier cookie to be set on every response. The expiration is reset to the original maxAge, resetting the expiration countdown. default is false */ + sameSite: this.get('session samesite') /** (string) session cookie sameSite options (default null, don't set it) */ }; app.use(session(sessionOptions, app));
Ensure samesite can be set on downstream applications
raveljs_ravel
train
js
9e658e09e6bbdbebb53c3aff91ad2494bcb36e53
diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index <HASH>..<HASH> 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1971,6 +1971,15 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $this->Status = "Unpublished"; $this->write(); + // Unpublish all virtual pages that point here + // This coupling to the subsites module is frustrating, but difficult to avoid. + if(class_exists('Subsite')) { + $virtualPages = Subsite::get_from_all_subsites('VirtualPage', "CopyContentFromID = {$this->ID}"); + } else { + $virtualPages = DataObject::get('VirtualPage', "CopyContentFromID = {$this->ID}"); + } + if ($virtualPages) foreach($virtualPages as $vp) $vp->doUnpublish(); + $this->extend('onAfterUnpublish'); }
MINOR when a parent page is unpublished, unpublish all related virtual pages, includes test coverage (from r<I>) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/<I>@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
043afac2908705de87d899a9a3f4d271d97f1c4d
diff --git a/core/pog/src/main/java/org/overture/pog/obligation/NonZeroObligation.java b/core/pog/src/main/java/org/overture/pog/obligation/NonZeroObligation.java index <HASH>..<HASH> 100644 --- a/core/pog/src/main/java/org/overture/pog/obligation/NonZeroObligation.java +++ b/core/pog/src/main/java/org/overture/pog/obligation/NonZeroObligation.java @@ -40,7 +40,7 @@ public class NonZeroObligation extends ProofObligation public NonZeroObligation( ILexLocation location, PExp exp, IPOContextStack ctxt) { - super(exp, POType.NON_ZERO, ctxt, exp.getLocation()); + super(exp, POType.NON_ZERO, ctxt, location); // exp <> 0
Changed NonZero location to the divide operator.
overturetool_overture
train
java
b3304efa9ce070d8028bd4293ac48021d066a721
diff --git a/src/constants.js b/src/constants.js index <HASH>..<HASH> 100644 --- a/src/constants.js +++ b/src/constants.js @@ -6,8 +6,6 @@ module.exports = { regex: { digits: /\d+/, letters: /[a-zA-Z]+/, - uppercase: /[A-Z]+/, - lowercase: /[a-z]+/, symbols: /[`~\!@#\$%\^\&\*\(\)\-_\=\+\[\{\}\]\\\|;:'",<.>\/\?€£¥₹]+/, spaces: /[\s]+/ } diff --git a/src/lib.js b/src/lib.js index <HASH>..<HASH> 100644 --- a/src/lib.js +++ b/src/lib.js @@ -85,14 +85,14 @@ module.exports = { * Method to validate the presence of uppercase letters */ uppercase: function uppercase() { - return _process.call(this, regex.uppercase); + return this.password !== this.password.toLowerCase(); }, /** * Method to validate the presence of lowercase letters */ lowercase: function lowercase() { - return _process.call(this, regex.lowercase); + return this.password !== this.password.toUpperCase(); }, /**
Add support for non-english lower/upper case Fixes #<I>. Thanks @nikvaessen for proposing this.
tarunbatra_password-validator
train
js,js
f3f555a88d4f5df3e5cf147e2ab9b8d3d73f2f20
diff --git a/salt/modules/grains.py b/salt/modules/grains.py index <HASH>..<HASH> 100644 --- a/salt/modules/grains.py +++ b/salt/modules/grains.py @@ -2,6 +2,8 @@ Control aspects of the grains data ''' +from math import floor + # Seed the grains dict so cython will build __grains__ = {} @@ -12,13 +14,16 @@ __outputter__ = { } -def _str_sanitizer(instr): - return "{0}{1}".format(instr[:-4], 'X' * 4) +def _serial_sanitizer(instr): + '''Replaces the last 1/4 of a string with X's''' + length = len(instr) + index = int(floor(length * .75)) + return "{0}{1}".format(instr[:index], 'X' * (length - index)) # A dictionary of grain -> function mappings for sanitizing grain output. This # is used when the 'sanitize' flag is given. _sanitizers = { - 'serialnumber': _str_sanitizer, + 'serialnumber': _serial_sanitizer, 'domain': lambda x: 'domain', 'fqdn': lambda x: 'minion.domain', 'host': lambda x: 'minion',
Tweak sanitizer to work with serials of any length
saltstack_salt
train
py
2f0f8a4824349ae9196397dced18f5359d68748a
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -767,7 +767,11 @@ func doRequestFollowRedirects(req *Request, dst []byte, url string, c clientDoer break } statusCode = resp.Header.StatusCode() - if statusCode != StatusMovedPermanently && statusCode != StatusFound && statusCode != StatusSeeOther { + if statusCode != StatusMovedPermanently && + statusCode != StatusFound && + statusCode != StatusSeeOther && + statusCode != StatusTemporaryRedirect && + statusCode != StatusPermanentRedirect { break }
Fix supported redirect status codes Support the same redirect status codes as the golang standard library does: <URL>
valyala_fasthttp
train
go
0b44170b6aa1e448e85c21c896de12e3691965a5
diff --git a/gnosis/eth/ethereum_network.py b/gnosis/eth/ethereum_network.py index <HASH>..<HASH> 100644 --- a/gnosis/eth/ethereum_network.py +++ b/gnosis/eth/ethereum_network.py @@ -354,6 +354,7 @@ class EthereumNetwork(Enum): HARADEV_TESTNET = 197710212031 MILKOMEDA_C1_MAINNET = 2001 MILKOMEDA_C1_TESTNET = 200101 + MILKOMEDA_A1_TESTNET = 200202 CLOUDWALK_MAINNET = 2009 CLOUDWALK_TESTNET = 2008 ALAYA_DEV_TESTNET = 201030
Add milkomeda algorand testnet (#<I>)
gnosis_gnosis-py
train
py
6f07b90537f9c64df6d0d5d19e767e59b5d3e0ee
diff --git a/src/components/Select.js b/src/components/Select.js index <HASH>..<HASH> 100644 --- a/src/components/Select.js +++ b/src/components/Select.js @@ -188,7 +188,7 @@ const Select = React.createClass({ type={this.state.isOpen ? 'caret-up' : 'caret-down'} /> </div> - {this.props.options.length ? this._renderOptions() : null} + {this.props.options.length || this.props.children ? this._renderOptions() : null} </div> {isMobile ? (
fix conditional for render select options to account for this.props.children
mxenabled_mx-react-components
train
js
ca760ca9e78b454f0d8feb17606bed252ce461b8
diff --git a/Str.php b/Str.php index <HASH>..<HASH> 100644 --- a/Str.php +++ b/Str.php @@ -38,13 +38,17 @@ class Str */ public static function after($subject, $search) { - if (! static::contains($subject, $search)) { + if ($search == '') { return $subject; } - $end = strpos($subject, $search) + static::length($search); + $pos = strpos($subject, $search); - return static::substr($subject, $end, static::length($subject)); + if ($pos === false) { + return $subject; + } + + return substr($subject, $pos + strlen($search)); } /**
Fixes and optimizations for Str::after (#<I>) * Correct results if there are multibyte characters before the search * Do not trigger warning if search is an empty string Also, should be significantly faster.
illuminate_support
train
php
9bdaed1bd67b111a78b11c3b010e507ccbf5c6b3
diff --git a/lib/yao/resources/server.rb b/lib/yao/resources/server.rb index <HASH>..<HASH> 100644 --- a/lib/yao/resources/server.rb +++ b/lib/yao/resources/server.rb @@ -42,6 +42,10 @@ module Yao::Resources action(id,"resize" => { "flavorRef" => flavor_id }) end + def self.add_security_group(server_id, security_group_name) + action(server_id, {"addSecurityGroup": {"name": security_group_name}}) + end + class << self alias :stop :shutoff
support AddSecurityGroup action
yaocloud_yao
train
rb
c0a46301b9501917c1d655dbe494f0cd2af15ebe
diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index <HASH>..<HASH> 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -77,7 +77,7 @@ import salt.fileserver as fs import salt.modules import salt.utils import salt.utils.s3 as s3 -import six +import salt.utils.six as six from six.moves import filter log = logging.getLogger(__name__)
Replaced import six in file /salt/fileserver/s3fs.py
saltstack_salt
train
py
519249353ca97a095ddd43ae31a085d05bf7473e
diff --git a/lib/poolparty/base_packages/poolparty.rb b/lib/poolparty/base_packages/poolparty.rb index <HASH>..<HASH> 100644 --- a/lib/poolparty/base_packages/poolparty.rb +++ b/lib/poolparty/base_packages/poolparty.rb @@ -40,7 +40,7 @@ module PoolParty has_gempackage(:name => "poolparty-latest", :download_url => "http://github.com/auser/poolparty/tree/master%2Fpkg%2Fpoolparty-latest.gem?raw=true", :requires => [get_gempackage("ruby2ruby"), get_gempackage("RubyInline"), get_gempackage("ParseTree")]) - has_exec(:name => "build_messenger", :command => ". /etc/profile && server-build-messenger", :requires => get_gempackage("poolparty")) + has_exec(:name => "build_messenger", :command => ". /etc/profile && server-build-messenger", :requires => get_gempackage("poolparty-latest")) has_exec(:name => "start_node", :command => ". /etc/profile && server-start-node", :requires => get_exec("build_messenger")) end
Ensures that poolparty is installed before trying to start the messenger
auser_poolparty
train
rb
5b077c2022f150a8143a306df0ae8dae6427a4a8
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index <HASH>..<HASH> 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -717,7 +717,6 @@ class SFTPClient(BaseSFTP, ClosingContextManager): .. versionchanged:: 1.7.4 Added the ``callback`` param """ - file_size = self.stat(remotepath).st_size with open(localpath, 'wb') as fl: size = self.getfo(remotepath, fl, callback) s = os.stat(localpath)
Remove vestigial extra 'stat' call in SFTPClient.get() Was apparently not removed when getfo() was born.
paramiko_paramiko
train
py
c1e6099f4ead51c200dccfe8158afb5b596f16e1
diff --git a/Generative-Adversarial-Networks/pygan/generativemodel/conditional_generative_model.py b/Generative-Adversarial-Networks/pygan/generativemodel/conditional_generative_model.py index <HASH>..<HASH> 100644 --- a/Generative-Adversarial-Networks/pygan/generativemodel/conditional_generative_model.py +++ b/Generative-Adversarial-Networks/pygan/generativemodel/conditional_generative_model.py @@ -5,7 +5,7 @@ from abc import abstractmethod class ConditionalGenerativeModel(GenerativeModel): ''' - Generate samples based on the conditonal noise prior. + Generate samples based on the conditional noise prior. `GenerativeModel` that has a `Conditioner`, where the function of `Conditioner` is a conditional mechanism to use previous knowledge @@ -16,7 +16,7 @@ class ConditionalGenerativeModel(GenerativeModel): This model observes not only random noises but also any other prior information as a previous knowledge and outputs feature points. - Dut to the `Conditoner`, this model has the capacity to exploit + Dut to the `Conditioner`, this model has the capacity to exploit whatever prior knowledge that is available and can be represented as a matrix or tensor.
Update for pre learning, typo, and verbose.
chimera0_accel-brain-code
train
py
80fc4c4ab38a498aa82bfe5a2a0654a0cb5b9ddd
diff --git a/lib/rom/lint/repository.rb b/lib/rom/lint/repository.rb index <HASH>..<HASH> 100644 --- a/lib/rom/lint/repository.rb +++ b/lib/rom/lint/repository.rb @@ -22,6 +22,11 @@ module ROM # @api public attr_reader :uri + # Repository instance used in lint tests + # + # @api private + attr_reader :repository_instance + # Create a repository linter # # @param [Symbol] identifier @@ -66,11 +71,6 @@ module ROM private - # Repository instance - # - # @api private - attr_reader :repository_instance - # Setup repository instance # # @api private
Make repository_instance public in Lint::Repository It's still tagged as `private` via YARD tag which OK. After this commit that warning is gone: rom/lib/rom/lint/repository.rb:<I>: warning: private attribute?
rom-rb_rom
train
rb
dd15541a687c0ae0ffd5cae99d07a54315bafd7f
diff --git a/util/src/main/java/org/vesalainen/fx/PreferencesBindings.java b/util/src/main/java/org/vesalainen/fx/PreferencesBindings.java index <HASH>..<HASH> 100644 --- a/util/src/main/java/org/vesalainen/fx/PreferencesBindings.java +++ b/util/src/main/java/org/vesalainen/fx/PreferencesBindings.java @@ -92,6 +92,11 @@ public class PreferencesBindings Property<E> enumProperty = getEnumProperty(key, def); return Bindings.createObjectBinding(()->enumProperty.getValue(), enumProperty); } + public <T> ObjectBinding<T> createObjectBinding(String key, T def, StringConverter<T> converter) + { + Property<T> property = getObjectProperty(key, def, converter); + return Bindings.createObjectBinding(()->property.getValue(), property); + } public <T> void bindBiDirectional(String key, T def, Property<T> property, StringConverter<T> converter) { Bindings.bindBidirectional(property, getObjectProperty(key, def, converter));
Added createObjectBinding
tvesalainen_util
train
java
45358e68e45dc2162e2c39d5e73db154f251f55a
diff --git a/app/models/content_type.rb b/app/models/content_type.rb index <HASH>..<HASH> 100644 --- a/app/models/content_type.rb +++ b/app/models/content_type.rb @@ -6,6 +6,7 @@ class ContentType < ActiveRecord::Base acts_as_paranoid validates :name, :creator, presence: true + validates :name, uniqueness: true after_save :rebuild_content_items_index belongs_to :creator, class_name: "User" @@ -25,7 +26,7 @@ class ContentType < ActiveRecord::Base def content_items_index_name content_type_name_sanitized = name.parameterize('_') - "#{Rails.env}_content_type_#{content_type_name_sanitized}_#{id}_content_items" + "#{Rails.env}_content_type_#{content_type_name_sanitized}_content_items" end def wizard_decorator
Content Type name now must validate uniqueness, modify mapping to reflect
cortex-cms_cortex
train
rb
374241fa0ac67977fd0d2e08f16e0ac787c28c85
diff --git a/mapchete/io/raster.py b/mapchete/io/raster.py index <HASH>..<HASH> 100644 --- a/mapchete/io/raster.py +++ b/mapchete/io/raster.py @@ -162,12 +162,12 @@ def _get_warped_array( dst_nodata = src.nodata if dst_nodata is None else dst_nodata with WarpedVRT( src, - dst_crs=dst_crs, + crs=dst_crs, src_nodata=src_nodata, - dst_nodata=dst_nodata, - dst_width=dst_shape[-2], - dst_height=dst_shape[-1], - dst_transform=Affine( + nodata=dst_nodata, + width=dst_shape[-2], + height=dst_shape[-1], + transform=Affine( (dst_bounds[2] - dst_bounds[0]) / dst_shape[-2], 0, dst_bounds[0], 0, (dst_bounds[1] - dst_bounds[3]) / dst_shape[-1],
rename kwargs to be compliant with rasterio <I>
ungarj_mapchete
train
py
7e7df69324831d6b8e3c345a0d60591edd8cceae
diff --git a/celerymon/handlers/api.py b/celerymon/handlers/api.py index <HASH>..<HASH> 100644 --- a/celerymon/handlers/api.py +++ b/celerymon/handlers/api.py @@ -1,6 +1,7 @@ from __future__ import absolute_import from functools import wraps +import types import anyjson from tornado.web import RequestHandler, HTTPError @@ -16,6 +17,8 @@ def JSON(fun): @wraps(fun) def _write_json(self, *args, **kwargs): content = fun(self, *args, **kwargs) + if isinstance(content, types.GeneratorType): + content = list(content) self.write(anyjson.serialize(content)) return _write_json
unrolling generators before json encoding
celery_celerymon
train
py
27186dd9de8f2e3fbb06a61dd7bef1273c45a59b
diff --git a/bootstrap_py/docs.py b/bootstrap_py/docs.py index <HASH>..<HASH> 100644 --- a/bootstrap_py/docs.py +++ b/bootstrap_py/docs.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- """bootstrap_py.docs.""" +import os.path import shlex import subprocess @@ -35,4 +36,13 @@ def build_sphinx(pkg_data, projectdir): version=version, release=pkg_data.version, projectdir=projectdir) - return subprocess.call(shlex.split(args)) + if subprocess.call(shlex.split(args)) is 0: + _touch_gitkeep(projectdir) + + +def _touch_gitkeep(docs_path): + with open(os.path.join(docs_path, + 'source', + '_static', + '.gitkeep'), 'w') as fobj: + fobj.write('')
Adds touching docs/source/_static/.gitkeep.
mkouhei_bootstrap-py
train
py
a39ec413f896a37dff069d127fded5c19d3854c6
diff --git a/field/__init__.py b/field/__init__.py index <HASH>..<HASH> 100644 --- a/field/__init__.py +++ b/field/__init__.py @@ -33,6 +33,19 @@ parser.add_argument( '-d', '--delimiter', default=None, help='delimiter between fields', type=str) + +def split_lines(filehandle, delim): + for line in filehandle: + yield line.strip('\n').split(delim) + + +def extract_fields(filehandle, delim, columns): + lines = split_lines(filehandle, delim) + for line in lines: + if max(columns) <= len(line): + yield (line[c-1] for c in columns) + + def main(): """ Main Entry Point @@ -47,8 +60,7 @@ def main(): print line, exit(0) - lines = (line.strip('\n').split(delim) for line in filehandle) - fields = ((line[c-1] for c in columns) for line in lines if max(columns) <= len(line)) + fields = extract_fields(filehandle, delim, columns) for line in fields: print ' '.join(line)
Expand single line generators into functions.
bramwelt_field
train
py
7c9b42b79527d8a044bcd578d216c5aaf69438e9
diff --git a/src/Common/QueryConnector.php b/src/Common/QueryConnector.php index <HASH>..<HASH> 100644 --- a/src/Common/QueryConnector.php +++ b/src/Common/QueryConnector.php @@ -30,4 +30,5 @@ class QueryConnector const MATCH = 'match'; const RANGE = 'range'; const TERMS = 'terms'; + const NAME_WILDCARD = 'wildcard'; }
<I> - Added additional constant.
g4code_data-mapper
train
php
8315b0f87a2ef160f4964af6862d2fb2979583f2
diff --git a/web/concrete/core/controllers/blocks/content.php b/web/concrete/core/controllers/blocks/content.php index <HASH>..<HASH> 100644 --- a/web/concrete/core/controllers/blocks/content.php +++ b/web/concrete/core/controllers/blocks/content.php @@ -98,14 +98,14 @@ public static function replaceImagePlaceHolderOnImport($match) { $filename = $match[1]; $db = Loader::db(); - $fID = $db->GetOne('select fID from FileVersions where filename = ?', array($filename)); + $fID = $db->GetOne('select fID from FileVersions where fvFilename = ?', array($filename)); return '{CCM:FID_' . $fID . '}'; } public static function replaceFilePlaceHolderOnImport($match) { $filename = $match[1]; $db = Loader::db(); - $fID = $db->GetOne('select fID from FileVersions where filename = ?', array($filename)); + $fID = $db->GetOne('select fID from FileVersions where fvFilename = ?', array($filename)); return '{CCM:FID_DL_' . $fID . '}'; }
fixing image and file in content importer Former-commit-id: <I>f<I>af<I>d<I>f<I>a<I>a1afc<I>
concrete5_concrete5
train
php
cc47e96b1e1b8190860c82ba75ba93d677367221
diff --git a/test/api.js b/test/api.js index <HASH>..<HASH> 100644 --- a/test/api.js +++ b/test/api.js @@ -65,7 +65,7 @@ describe('Module API', () => { }); }); - describe('_()', () => { + describe('__()', () => { it('should return en translations as expected', () => { i18n.setLocale('en');
api tests ported from i<I>n-node
TrigenSoftware_i18n-for-browser
train
js
aa42f4309c3c40b4449f2574df06c519dff73016
diff --git a/hugolib/site.go b/hugolib/site.go index <HASH>..<HASH> 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -314,7 +314,7 @@ func (s *Site) CreatePages() (err error) { panic(fmt.Sprintf("s.Source not set %s", s.absContentDir())) } if len(s.Source.Files()) < 1 { - return fmt.Errorf("No source files found in %s", s.absContentDir()) + return } var wg sync.WaitGroup
allow site to be built with empty content Build the site even if there isn't anything in the content directory.
gohugoio_hugo
train
go
f58d62f4779a77882d882b85abc0303140ccb41c
diff --git a/yowsup/common/tools.py b/yowsup/common/tools.py index <HASH>..<HASH> 100644 --- a/yowsup/common/tools.py +++ b/yowsup/common/tools.py @@ -82,7 +82,9 @@ class WATools: b64Hash = base64.b64encode(sha1.digest()) return b64Hash if type(b64Hash) is str else b64Hash.decode() + class StorageTools: + NAME_CONFIG = "config.json" @staticmethod def constructPath(*path): @@ -129,6 +131,13 @@ class StorageTools: def getIdentity(cls, phone): return cls.readPhoneData(phone, 'id') + @classmethod + def writePhoneConfig(cls, phone, config): + cls.writePhoneData(phone, cls.NAME_CONFIG, config) + + @classmethod + def readPhoneConfig(cls, phone, config): + return cls.readPhoneData(phone, cls.NAME_CONFIG) class TimeTools: @staticmethod
[feat] add read/write phone config to StorageTools
tgalal_yowsup
train
py
ab1c451e417bc8407a06412540aa86a0e225c898
diff --git a/scot/parallel.py b/scot/parallel.py index <HASH>..<HASH> 100644 --- a/scot/parallel.py +++ b/scot/parallel.py @@ -21,14 +21,14 @@ def parallel_loop(func, n_jobs=1, verbose=1): ----- Execution of the main script must be guarded with `if __name__ == '__main__':` when using parallelization. """ - try: - if n_jobs: - from joblib import Parallel, delayed - except ImportError: + if n_jobs: try: - from sklearn.externals.joblib import Parallel, delayed + from joblib import Parallel, delayed except ImportError: - n_jobs = None + try: + from sklearn.externals.joblib import Parallel, delayed + except ImportError: + n_jobs = None if not n_jobs: if verbose is not None and verbose >= 10:
fixed joblib import and added debug output
scot-dev_scot
train
py
950547b8006389e572d649d163c9a9e9f5fbbd11
diff --git a/tests/Kwf/Exception/ExceptionTest.php b/tests/Kwf/Exception/ExceptionTest.php index <HASH>..<HASH> 100644 --- a/tests/Kwf/Exception/ExceptionTest.php +++ b/tests/Kwf/Exception/ExceptionTest.php @@ -81,6 +81,7 @@ class Kwf_Exception_ExceptionTest extends Kwf_Test_TestCase private function _processException($exception) { + Kwf_Benchmark::disable(); $view = new Kwf_Exception_TestView(); Kwf_Debug::setView($view); Kwf_Debug::handleException($exception, true);
no benchmark-output on exception-tests i don't know why it started to output, this was the easiest way to stop it
koala-framework_koala-framework
train
php
3a4aa2793f18b88903f0dfec5ee40e0f33d21f3b
diff --git a/examples/full.js b/examples/full.js index <HASH>..<HASH> 100644 --- a/examples/full.js +++ b/examples/full.js @@ -7,7 +7,7 @@ var proc = new ffmpeg('/path/to/your_movie.avi') // set target codec .withVideoCodec('divx') // set aspect ratio - .withAspectRatio('16:9') + .withAspect('16:9') // set size in percent .withSize('50%') // set fps @@ -25,4 +25,4 @@ var proc = new ffmpeg('/path/to/your_movie.avi') // save to file .saveToFile('/path/to/your_target.avi', function(retcode, error){ console.log('file has been converted succesfully'); - }); \ No newline at end of file + });
Updated the example to use right API method to set aspect-ratio
fluent-ffmpeg_node-fluent-ffmpeg
train
js
c51ea97234f25fd2ac70edd9de30416445f194d9
diff --git a/configuration/configuration.go b/configuration/configuration.go index <HASH>..<HASH> 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -311,6 +311,10 @@ func parseV0_1Registry(in []byte) (*Configuration, error) { config.Reporting.NewRelic.Name = newRelicName } + if httpAddr, ok := envMap["REGISTRY_HTTP_ADDR"]; ok { + config.HTTP.Addr = httpAddr + } + return (*Configuration)(&config), nil }
Allows HTTP bind address to be overridden by an environment variable Uses REGISTRY_HTTP_ADDR
docker_distribution
train
go
c76f7e657d452ac56a28c1ce5b846c2bb2600b6f
diff --git a/backtrader/analyzers/tradeanalyzer.py b/backtrader/analyzers/tradeanalyzer.py index <HASH>..<HASH> 100644 --- a/backtrader/analyzers/tradeanalyzer.py +++ b/backtrader/analyzers/tradeanalyzer.py @@ -52,9 +52,21 @@ class TradeAnalyzer(Analyzer): - Long/Short Total/Average/Max/Min - Won/Lost Total/Average/Max/Min + + Note: + + The analyzer uses an "auto"dict for the fields, which means that if no + trades are executed, no statistics will be generated. + + In that case there will be a single field/subfield in the dictionary + returned by ``get_analysis``, namely: + + - dictname['total']['total'] which will have a value of 0 (the field is + also reachable with dot notation dictname.total.total ''' def start(self): self.trades = AutoOrderedDict() + self.trades.total.total = 0 def stop(self): self.trades._close()
Fixes #<I> by adding a default of total.total = 0 to indicate that no trades were executed and therefore no statistics
backtrader_backtrader
train
py
998bc43fdfb64d11878f8f1e875e8a69c2addef3
diff --git a/Controller/PageAdminController.php b/Controller/PageAdminController.php index <HASH>..<HASH> 100644 --- a/Controller/PageAdminController.php +++ b/Controller/PageAdminController.php @@ -526,16 +526,17 @@ class PageAdminController extends CRUDController try { $layoutBlock = $repo->find($blockId); + if ($layoutBlock) { + $em = $this->getDoctrine()->getManager(); + $em->persist($layoutBlock); + $em->remove($layoutBlock); + $em->flush(); + } } catch (\Exception $e) { $message = $e->getMessage(); return new JsonResponse(array('messageStatus' => 'error', 'message' => $message)); } - - $em = $this->getDoctrine()->getManager(); - $em->persist($layoutBlock); - $em->remove($layoutBlock); - $em->flush(); } return new JsonResponse(array(
fix bug when deleting layout blocks that have not yet been persisted to the db
networking_init-cms-bundle
train
php
56b0bcb5b3b8a24a1d004cfda7961719b821ca7e
diff --git a/src/main/java/com/couchbase/lite/Database.java b/src/main/java/com/couchbase/lite/Database.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/Database.java +++ b/src/main/java/com/couchbase/lite/Database.java @@ -3263,6 +3263,7 @@ public class Database { Log.e(Database.TAG, "Error deleting revisions", e); return false; } + revsPurged = new ArrayList<String>(); revsPurged.add("*"); } else { // Iterate over all the revisions of the doc, in reverse sequence order.
fix in Database.purgeRevisions
couchbase_couchbase-lite-java-core
train
java
25a07f60a7a087f0946fa8d27d9f5740c033209e
diff --git a/react/Textarea/Textarea.demo.js b/react/Textarea/Textarea.demo.js index <HASH>..<HASH> 100644 --- a/react/Textarea/Textarea.demo.js +++ b/react/Textarea/Textarea.demo.js @@ -71,13 +71,6 @@ export default { }) }, { - label: 'Secondary Label', - transformProps: props => ({ - ...props, - secondaryLabel: '(secondary)' - }) - }, - { label: 'Show Count', transformProps: props => ({ ...props, diff --git a/react/private/FieldMessage/FieldMessage.demo.js b/react/private/FieldMessage/FieldMessage.demo.js index <HASH>..<HASH> 100644 --- a/react/private/FieldMessage/FieldMessage.demo.js +++ b/react/private/FieldMessage/FieldMessage.demo.js @@ -1,18 +1,5 @@ export default [ { - label: 'Secondary', - type: 'checklist', - states: [ - { - label: 'Secondary message', - transformProps: props => ({ - ...props, - messageProps: { secondary: true } - }) - } - ] - }, - { label: 'Message', type: 'radio', states: [
docs(site): Clean up form element demos (#<I>) Some form element demos were starting to collect a few too many options, but some of them were either an edge case or completely redundant.
seek-oss_seek-style-guide
train
js,js
d78d9744c6f5fd3e6547a802a5b8e26c403ca5d4
diff --git a/javascript/ajaxselect2.init.js b/javascript/ajaxselect2.init.js index <HASH>..<HASH> 100644 --- a/javascript/ajaxselect2.init.js +++ b/javascript/ajaxselect2.init.js @@ -2,6 +2,7 @@ $.entwine("select2", function($) { $("input.ajaxselect2").entwine({ onmatch: function() { + this._super(); var self = this; self.select2({ multiple: self.data('multiple'), diff --git a/javascript/select2.init.js b/javascript/select2.init.js index <HASH>..<HASH> 100644 --- a/javascript/select2.init.js +++ b/javascript/select2.init.js @@ -1,10 +1,10 @@ -jQuery.entwine("select2", function($) { - - $("select.select2").entwine({ - onmatch: function() { - var self = this; - self.select2(); - }, +(function($) { + $.entwine("select2", function($) { + $("select.select2").entwine({ + onmatch: function() { + this._super(); + this.select2(); + } + }); }); -}); - +})(jQuery); \ No newline at end of file
fix(Entwine): Add this._super() to avoid weird breaking issues, Change select2.init.js to be consistent with ajaxselect2.init.js formatting
sheadawson_silverstripe-select2
train
js,js
f117795c9289d4bce8ee06dc3b6cce5387de38a2
diff --git a/lib/ffi-geos/coordinate_sequence.rb b/lib/ffi-geos/coordinate_sequence.rb index <HASH>..<HASH> 100644 --- a/lib/ffi-geos/coordinate_sequence.rb +++ b/lib/ffi-geos/coordinate_sequence.rb @@ -160,6 +160,10 @@ module Geos }.read_int end + def to_point + Geos.create_point(self) + end + def to_linear_ring Geos.create_linear_ring(self) end diff --git a/test/coordinate_sequence_tests.rb b/test/coordinate_sequence_tests.rb index <HASH>..<HASH> 100644 --- a/test/coordinate_sequence_tests.rb +++ b/test/coordinate_sequence_tests.rb @@ -123,6 +123,11 @@ class CoordinateSequenceTests < Test::Unit::TestCase end end + def test_to_point + cs = Geos::CoordinateSequence.new([5,7]) + assert_equal('POINT (5 7)', write(cs.to_point, :trim => true)) + end + def test_to_to_linear_ring cs = Geos::CoordinateSequence.new([ [ 0, 0 ],
Add CoordinateSequence#to_point support to match the other geometry constructors.
dark-panda_ffi-geos
train
rb,rb
9bddfba22e55603f34e68f5ee719d97295d596ac
diff --git a/Classes/TestingFramework.php b/Classes/TestingFramework.php index <HASH>..<HASH> 100644 --- a/Classes/TestingFramework.php +++ b/Classes/TestingFramework.php @@ -9,6 +9,7 @@ use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\TimeTracker\NullTimeTracker; use TYPO3\CMS\Core\TimeTracker\TimeTracker; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\RootlineUtility; use TYPO3\CMS\Core\Utility\VersionNumberUtility; use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -945,7 +946,7 @@ final class Tx_Oelib_TestingFramework } } - \TYPO3\CMS\Core\Utility\RootlineUtility::purgeCaches(); + RootlineUtility::purgeCaches(); } /**
[CLEANUP] Import the RootlineUtility in TestingFramework (#<I>)
oliverklee_ext-oelib
train
php
eabc1505b32161dfaea7ced161f63776346cf105
diff --git a/helpers/config.go b/helpers/config.go index <HASH>..<HASH> 100644 --- a/helpers/config.go +++ b/helpers/config.go @@ -31,11 +31,10 @@ type Config struct { PersistentAppOrg string `json:"persistent_app_org"` PersistentAppQuotaName string `json:"persistent_app_quota_name"` - SkipSSLValidation bool `json:"skip_ssl_validation"` - Backend string `json:"backend"` - IncludeRouteServices bool `json:"include_route_services"` - IncludeDiegoDocker bool `json:"include_diego_docker"` - IncludeTasks bool `json:"include_tasks"` + SkipSSLValidation bool `json:"skip_ssl_validation"` + Backend string `json:"backend"` + IncludeDiegoDocker bool `json:"include_diego_docker"` + IncludeTasks bool `json:"include_tasks"` ArtifactsDirectory string `json:"artifacts_directory"`
Remove include_route_services property from config [#<I>]
cloudfoundry-incubator_cf-test-helpers
train
go
20dfe28fb6a52c317f5abba4dd7dda69436c7eee
diff --git a/docs/next/postcss.config.js b/docs/next/postcss.config.js index <HASH>..<HASH> 100644 --- a/docs/next/postcss.config.js +++ b/docs/next/postcss.config.js @@ -1,6 +1,6 @@ module.exports = { plugins: { - "@tailwindcss/jit": {}, + tailwindcss: {}, autoprefixer: {}, }, };
[docs-infra] Switch css compilation back to purge Summary: Title. JIT might be causing the weird CSS issues we're seeing. Test Plan: bk Reviewers: yuhan Reviewed By: yuhan Differential Revision: <URL>
dagster-io_dagster
train
js
10f9ef04f49a991e61f0f0019e3e27161f9eba92
diff --git a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/patterns/Match.java b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/patterns/Match.java index <HASH>..<HASH> 100644 --- a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/patterns/Match.java +++ b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/patterns/Match.java @@ -419,6 +419,9 @@ public class Match { * @return Converted string. */ private String convertCase(final String s) { + if (StringTools.isEmpty(s)) { + return s; + } String token = s; switch (caseConversionType) { case NONE:
add emptiness test to avoid nullpointer etc. errors in case of errors
languagetool-org_languagetool
train
java
e40a557bef63d3a1bf4b186720fc6cf3f03cdef6
diff --git a/tests/Classes/PHP80.php b/tests/Classes/PHP80.php index <HASH>..<HASH> 100644 --- a/tests/Classes/PHP80.php +++ b/tests/Classes/PHP80.php @@ -6,6 +6,7 @@ namespace Brick\Reflection\Tests\Classes; use Brick\Reflection\Tests\A; use Brick\Reflection\Tests\Attributes\ExpectFunctionSignature; +use Closure; use stdClass; const TEST = 1; @@ -93,6 +94,12 @@ abstract class PHP80 #[ExpectFunctionSignature('public function & returnWithReference(): void')] public function & returnWithReference(): void {} + #[ExpectFunctionSignature('public function iterables(iterable $a, \stdClass|iterable $b): iterable')] + public function iterables(iterable $a, stdClass|iterable $b): iterable {} + + #[ExpectFunctionSignature('public function callables(callable $a, \Closure|callable $b): callable')] + public function callables(callable $a, Closure|callable $b): callable {} + #[ExpectFunctionSignature( 'abstract protected static function & kitchenSink(' . '$a, ' .
Tests for iterable & callable
brick_reflection
train
php
f88762fe1af63e1529e9001ce957b3df4e97aba5
diff --git a/lib/middleware/copyright.js b/lib/middleware/copyright.js index <HASH>..<HASH> 100644 --- a/lib/middleware/copyright.js +++ b/lib/middleware/copyright.js @@ -18,11 +18,11 @@ var parse = require('parse-copyright'); */ module.exports = function copyright_(verb) { + var copyright = verb.get('data.copyright'); var readme = verb.files('README.md'); var parsed = false; - var copyright; - if (!parsed && readme.length) { + if (!parsed && !copyright && readme.length) { var str = fs.readFileSync(readme[0], 'utf8'); var res = update(str); if (res) { @@ -32,6 +32,10 @@ module.exports = function copyright_(verb) { } return function (file, next) { + if (typeof copyright === 'string') return next(); + if (typeof copyright === 'object' && Object.keys(copyright).length) { + return next(); + } copyright = verb.get('data.copyright') || parse(file.content)[0] || {}; verb.set('data.copyright', copyright); file.data.copyright = copyright;
skip if copyright is defined.
verbose_verb
train
js
b7fd5032a55658d4e62567d76d672c1a0b0398db
diff --git a/salt/modules/win_repo.py b/salt/modules/win_repo.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_repo.py +++ b/salt/modules/win_repo.py @@ -18,7 +18,7 @@ import salt.output import salt.utils import salt.loader import salt.template -from salt.exceptions import CommandExecutionError +from salt.exceptions import CommandExecutionError, SaltRenderError from salt.runners.winrepo import ( genrepo as _genrepo, update_git_repos as _update_git_repos @@ -165,7 +165,7 @@ def show_sls(name, saltenv='base'): __opts__['renderer']) # Dump return the error if any - except SaltRenderError as exc: # pylint: disable=E0602 + except SaltRenderError as exc: log.debug('Failed to compile {0}.'.format(sls_file)) log.debug('Error: {0}.'.format(exc)) config['Message'] = 'Failed to compile {0}'.format(sls_file)
I incorrectly ignored a lint error in a previous PR
saltstack_salt
train
py
067c59799ce47e298d05f0136a4734418f5ea2b1
diff --git a/src/StaticGeometry.js b/src/StaticGeometry.js index <HASH>..<HASH> 100644 --- a/src/StaticGeometry.js +++ b/src/StaticGeometry.js @@ -469,7 +469,7 @@ define(function(require) { generateBarycentric: function() { - if (! this.isUniqueVertex()) { + if (!this.isUniqueVertex()) { this.generateUniqueVertex(); } @@ -484,7 +484,7 @@ define(function(require) { for (var i = 0; i < faces.length;) { for (var j = 0; j < 3; j++) { var ii = faces[i++]; - array[ii + j] = 1; + array[ii * 3 + j] = 1; } } this.dirty();
StaticGeometry#generateBarycentric fix
pissang_claygl
train
js
346efb2109f0f0b69121889d82511c3ef549f7be
diff --git a/PyFunceble/__init__.py b/PyFunceble/__init__.py index <HASH>..<HASH> 100644 --- a/PyFunceble/__init__.py +++ b/PyFunceble/__init__.py @@ -910,17 +910,6 @@ def _command_line(): # pragma: no cover pylint: disable=too-many-branches,too-m ) PARSER.add_argument( - "--multiprocess", - action="store_true", - help="Switch the value of the multiprocess usage. %s" - % ( - CURRENT_VALUE_FORMAT - + repr(CONFIGURATION["multiprocessing"]) - + Style.RESET_ALL - ), - ) - - PARSER.add_argument( "-n", "--no-files", action="store_true", @@ -1273,11 +1262,6 @@ def _command_line(): # pragma: no cover pylint: disable=too-many-branches,too-m if ARGS.mining: CONFIGURATION.update({"mining": Preset().switch("mining")}) - if ARGS.multiprocess: - CONFIGURATION.update( - {"multiprocessing": Preset().switch("multiprocessing")} - ) - if ARGS.no_files: CONFIGURATION.update({"no_files": Preset().switch("no_files")})
Deletion of unneeded part (Might me reincluded in future version)
funilrys_PyFunceble
train
py
189007be5556336126a24e9bf28e2b6d4fe10883
diff --git a/src/bitpay/OmnipayMerchant.php b/src/bitpay/OmnipayMerchant.php index <HASH>..<HASH> 100644 --- a/src/bitpay/OmnipayMerchant.php +++ b/src/bitpay/OmnipayMerchant.php @@ -12,14 +12,36 @@ namespace hiqdev\php\merchant\bitpay; use hiqdev\php\merchant\Helper; use hiqdev\php\merchant\RequestInterface; -use Omnipay\BitPay\Message\PurchaseRequest; -use Omnipay\BitPay\Message\PurchaseResponse; +use Omnipay\BitPay\Gateway; +use Omnipay\Common\GatewayInterface; /** * BitPay Omnipay Merchant class. */ class OmnipayMerchant extends \hiqdev\php\merchant\OmnipayMerchant { + /** + * @return Gateway|GatewayInterface + */ + public function getWorker() + { + return parent::getWorker(); + } + + /** + * @param array $data + * @return array + */ + public function prepareData(array $data) + { + return array_merge([ + 'token' => $data['purse'], + 'privateKey' => $data['secret'], + 'publicKey' => $data['secret2'], + 'testMode' => false + ], $data); + } + public function request($type, array $data) { if (!empty($data['inputs'])) {
Updated to use hiqdev/omnipay-bitpay
hiqdev_php-merchant
train
php
bac629d3f64d2ddc4980edf0dfc10dbc46da86ee
diff --git a/app/actions/prottable/probability.py b/app/actions/prottable/probability.py index <HASH>..<HASH> 100644 --- a/app/actions/prottable/probability.py +++ b/app/actions/prottable/probability.py @@ -1,12 +1,12 @@ -from app.dataformats import mzidtsv as mzidtsvdata +from app.dataformats import peptable as peptabledata from app.dataformats import prottable as prottabledata def add_nesvi_protein_probability(proteins, peptides, headerfields): protein_probs = {} for peptide in peptides: - protacc = peptide[mzidtsvdata.HEADER_MASTER_PROT] - pep = peptide[mzidtsvdata.HEADER_PEPTIDE_PEP] + protacc = peptide[peptabledata.HEADER_MASTERPROTEINS] + pep = peptide[peptabledata.HEADER_PEP] if ';' in protacc or pep in ['NA', False]: continue pep = float(pep)
Correct header names of peptide table in adding probability data to protein table
glormph_msstitch
train
py
f9aae41005bc58d5eeadcaadd38b528f017ec4f1
diff --git a/karma-minified.conf.js b/karma-minified.conf.js index <HASH>..<HASH> 100644 --- a/karma-minified.conf.js +++ b/karma-minified.conf.js @@ -37,7 +37,7 @@ module.exports = function (config) { ], // list of files to exclude - exclude: ['source-minified/smart-elements.js'], + exclude: ['source-minified/smart.elements.js'], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
Update karma-minified.conf.js
HTMLElements_smarthtmlelements-core
train
js
ae603d33a577974f3b9c5892a75d57fb87843343
diff --git a/lancet/cli.py b/lancet/cli.py index <HASH>..<HASH> 100644 --- a/lancet/cli.py +++ b/lancet/cli.py @@ -59,7 +59,7 @@ def get_transition(ctx, lancet, issue, to_status): def assign_issue(lancet, issue, username, active_status=None): with taskstatus('Assigning issue to you') as ts: assignee = issue.fields.assignee - if not assignee or assignee.key != username: + if not assignee or assignee.name != username: if issue.fields.status.name == active_status: ts.abort('Issue already active and not assigned to you') else: @@ -365,7 +365,7 @@ def pull_request(ctx, base_branch, open_pr): ts.abort('No working branch found') assignee = issue.fields.assignee - if not assignee or assignee.key != username: + if not assignee or assignee.name != username: ts.abort('Issue currently not assigned to you') # TODO: Check mergeability
Compare against the assignee name, not key.
GaretJax_lancet
train
py
392ef51cd9ac8768ede3fdf57b97b9c737ea3971
diff --git a/lib/ronin/model/has_description.rb b/lib/ronin/model/has_description.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/model/has_description.rb +++ b/lib/ronin/model/has_description.rb @@ -27,8 +27,6 @@ module Ronin # Adds a `description` property to a model. # module HasDescription - include DataMapper::Types - def self.included(base) base.module_eval do include Ronin::Model diff --git a/lib/ronin/platform/cacheable.rb b/lib/ronin/platform/cacheable.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/platform/cacheable.rb +++ b/lib/ronin/platform/cacheable.rb @@ -107,7 +107,7 @@ module Ronin include Ronin::Model # The class-name of the cached object - property :type, DataMapper::Types::Discriminator + property :type, DataMapper::Property::Discriminator # The cached file of the object belongs_to :cached_file,
Do not use DataMapper::Types anymore, use DataMapper::Property instead.
ronin-ruby_ronin
train
rb,rb
985b843a89fe96eaf593d66b707a61ce39780d4e
diff --git a/graph/Transitive_Closure_DFS.py b/graph/Transitive_Closure_DFS.py index <HASH>..<HASH> 100644 --- a/graph/Transitive_Closure_DFS.py +++ b/graph/Transitive_Closure_DFS.py @@ -40,7 +40,6 @@ class Graph: print(self.tc) -# Create a graph given in the above diagram g = Graph(4) g.addEdge(0, 1) g.addEdge(0, 2)
Update Transitive_Closure_DFS.py
keon_algorithms
train
py
b05dfadc04934f5c0349a1fe45e3632ad6c15c0a
diff --git a/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java b/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java +++ b/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java @@ -20,6 +20,9 @@ import static net.openhft.chronicle.map.NodeDiscoveryHostPortBroadcaster.BOOTSTR import static net.openhft.chronicle.map.NodeDiscoveryHostPortBroadcaster.LOG; /** + * Broad cast the nodes host ports and identifiers over UDP, to make it easy to join a grid of remote nodes + * just by name, this functionality requires UDP + * * @author Rob Austin. */ public class NodeDiscoveryHostPortBroadcaster extends UdpChannelReplicator { @@ -479,18 +482,15 @@ class BytesExternalizableImpl implements BytesExternalizable { public void sendBootStrap() { bootstrapRequired.set(true); - } public void add(InetSocketAddress interfaceAddress) { allNodes.add(interfaceAddress); - } public void add(byte identifier) { allNodes.activeIdentifierBitSet().set(identifier); - }
HCOLL-<I> ( release draft cut of the code so that I can test it across my network )
OpenHFT_Chronicle-Map
train
java
f5221275ce7f379574b8c56244a9eee3c10596dc
diff --git a/app/controllers/admin/admin_controller.rb b/app/controllers/admin/admin_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/admin/admin_controller.rb +++ b/app/controllers/admin/admin_controller.rb @@ -2,14 +2,14 @@ module Admin # Public: Base admin system controller. Contains authentication, a dashboard, and a # style guide. Anything that must affect all admin pages should be added here. class AdminController < ::ApplicationController - # An AdminMiddleware module can be added to change any part of the - # base AdminController class' functionality. - try(:include, ::AdminMiddleware) - before_action :authenticate_admin! layout "admin/application" + # An AdminMiddleware module can be added to change any part of the base + # AdminController class functionality + try(:include, ::AdminMiddleware) + def dashboard render 'admin/dashboard' end
Moves AdminMiddleware inclusion below layout definition in AdminController in order to allow layout overrides
littlelines_ceo
train
rb
0c098ecd749da9af54015868a2c8f87e0cf61092
diff --git a/include/datawrappers/connectionwrapper_class.php b/include/datawrappers/connectionwrapper_class.php index <HASH>..<HASH> 100644 --- a/include/datawrappers/connectionwrapper_class.php +++ b/include/datawrappers/connectionwrapper_class.php @@ -37,7 +37,7 @@ class ConnectionWrapper { function BeginTransaction($queryid) { return false; } function Commit($queryid) { return false; } function Rollback($queryid) { return false; } - function Quote($queryid, $str) { return $str; } + function Quote($queryid, $str) { return '"' . addslashes($str) . '"'; } // default fallback string quoting function GenerateIndex($indexby, $item, $separator=".") { $idxby = explode(",", $indexby); foreach ($idxby as $k) {
- Made default DataManager::quote() behavior more consistent with what should be expected
jbaicoianu_elation
train
php
9949a0b9644c95b66f8ad7bebf2451641600d4c3
diff --git a/lib/amee/connection.rb b/lib/amee/connection.rb index <HASH>..<HASH> 100644 --- a/lib/amee/connection.rb +++ b/lib/amee/connection.rb @@ -298,7 +298,8 @@ module AMEE def cache_key(path) # We have to make sure cache keys don't get too long for the filesystem, # so we cut them off if they're too long and add a digest for uniqueness. - newpath = (path.length < 255) ? path : path.first(192)+Digest::MD5.hexdigest(path) + newpath = path.gsub(/[^0-9a-z\/]/i, '') + newpath = (newpath.length < 255) ? newpath : newpath.first(192)+Digest::MD5.hexdigest(newpath) (@server+newpath) end diff --git a/spec/cache_spec.rb b/spec/cache_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cache_spec.rb +++ b/spec/cache_spec.rb @@ -75,6 +75,11 @@ describe AMEE::Connection do c.expire_cache i = c.item :label => 'biodiesel' end + + it "removes special characters from cache keys" do + setup_connection + @connection.send(:cache_key, "/%cache/$4/%20test").should eql 'server.example.com/cache/4/20test' + end describe 'and automatic invalidation' do
Remove special chars from cache keys for Rails 3 compatibility. SDK-<I>
OpenAMEE_amee-ruby
train
rb,rb
a4bb7963a857865e667fcc4eb77c35f3332001de
diff --git a/geomdl/BSpline.py b/geomdl/BSpline.py index <HASH>..<HASH> 100644 --- a/geomdl/BSpline.py +++ b/geomdl/BSpline.py @@ -324,7 +324,7 @@ class Curve(object): return ret_check # Saves evaluated curve points to a CSV file - def save_surfpts_to_csv(self, filename=""): + def save_curvepts_to_csv(self, filename=""): """ Saves evaluated curve points to a comma separated text file. :param filename: output file name
Corrected function name to save_curvepts_to_csv
orbingol_NURBS-Python
train
py
b78505c290d3d1a41be5e28fdecab8353494737e
diff --git a/lib/generate/fs.js b/lib/generate/fs.js index <HASH>..<HASH> 100644 --- a/lib/generate/fs.js +++ b/lib/generate/fs.js @@ -16,7 +16,8 @@ var getFiles = function(path) { // Add extra rules to ignore common folders ig.addIgnoreRules([ - '.git/' + '.git/', + '.gitignore', ], '__custom_stuff'); // Push each file to our list
Ignore .gitignore file by default in fs.list Partial fix of #<I>
GitbookIO_gitbook
train
js
a83f27f4e348546bbdfb56fcb379a9fdddccf594
diff --git a/bcbio/variation/freebayes.py b/bcbio/variation/freebayes.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/freebayes.py +++ b/bcbio/variation/freebayes.py @@ -48,8 +48,7 @@ def run_freebayes(align_bams, ref_file, config, dbsnp=None, region=None, with file_transaction(out_file) as tx_out_file: cl = [config_utils.get_program("freebayes", config), "-b", align_bam, "-v", tx_out_file, "-f", ref_file, - "--left-align-indels", "--use-mapping-quality", - "--min-alternate-count", "2"] + "--use-mapping-quality", "--min-alternate-count", "2"] cl += _freebayes_options_from_config(config["algorithm"], out_file, region) subprocess.check_call(cl) _remove_freebayes_refalt_dups(out_file)
Removed --left-align-indels option. It is the default in <I> and throws an error if passed in.
bcbio_bcbio-nextgen
train
py
1577e8ed80d6abc8fdbc28ea7893ddc8d10bce2b
diff --git a/core-bundle/src/Resources/contao/drivers/DC_Folder.php b/core-bundle/src/Resources/contao/drivers/DC_Folder.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/drivers/DC_Folder.php +++ b/core-bundle/src/Resources/contao/drivers/DC_Folder.php @@ -935,7 +935,7 @@ class DC_Folder extends \DataContainer implements \listable, \editable // Upload the files $arrUploaded = $objUploader->uploadTo($strFolder); - if (empty($arrUploaded)) + if (empty($arrUploaded) && !$objUploader->hasError()) { \Message::addError($GLOBALS['TL_LANG']['ERR']['emptyUpload']); $this->reload();
[Core] Fix the file upload error message (see #<I>).
contao_contao
train
php
154c2cc3f86369435221b181d4cc281414637b13
diff --git a/packages/razzle/config/createConfigAsync.js b/packages/razzle/config/createConfigAsync.js index <HASH>..<HASH> 100644 --- a/packages/razzle/config/createConfigAsync.js +++ b/packages/razzle/config/createConfigAsync.js @@ -1022,7 +1022,7 @@ module.exports = ( } if (razzleOptions.debug.config) { console.log(`Printing webpack config for ${target} target`); - console.log(util.inspect(webpackConfig, {depth: null})); + console.log(util.inspect(config, {depth: null})); } resolve(config); });
fix(razzle): webpackConfig undefined webpackConfig undefined, i should be config
jaredpalmer_razzle
train
js
827b65ac8b70d93b3238a92c00dd632e61c35870
diff --git a/src/animanager/add.py b/src/animanager/add.py index <HASH>..<HASH> 100644 --- a/src/animanager/add.py +++ b/src/animanager/add.py @@ -2,8 +2,6 @@ import logging from datetime import date from urllib.parse import urlencode from xml.etree import ElementTree -import html.parser -import re import sys from animanager import inputlib @@ -26,11 +24,7 @@ def main(config, name=None): if not name: name = input("Search for: ") response = ffrequest(mal_search + urlencode({'q': name})) - h = html.parser.HTMLParser() response = response.read().decode() - response = h.unescape(response) - # due to some bug, there are double entities? e.g. &amp;amp; - response = re.sub(r'&.+?;', '', response) tree = ElementTree.fromstring(response) found = [ [_get(e, k) for k in ('id', 'title', 'episodes', 'type')]
Remove weird hack in add.py It was put in there to fix a weird formatting problem in the past from MAL's XML.
darkfeline_animanager
train
py
44b77f9495acdbdf5607654b0631c4746e50d814
diff --git a/tests/tests/lib/ezutils/ezmail_ezc_test.php b/tests/tests/lib/ezutils/ezmail_ezc_test.php index <HASH>..<HASH> 100644 --- a/tests/tests/lib/ezutils/ezmail_ezc_test.php +++ b/tests/tests/lib/ezutils/ezmail_ezc_test.php @@ -49,6 +49,9 @@ class eZMailEzcTest extends ezpTestCase */ public function testTipAFriend() { + $this->markTestSkipped( + 'smtp.ez.no is down for now' + ); $mail = new eZMail(); $mail->setSender( $this->adminEmail, $this->adminName ); $mail->setReceiver( $this->adminEmail, $this->adminName ); @@ -176,6 +179,9 @@ class eZMailEzcTest extends ezpTestCase public function testRegressionWrongPasswordCatchException() { + $this->markTestSkipped( + 'smtp.ez.no is down for now' + ); ezpINIHelper::setINISetting( 'site.ini', 'MailSettings', 'TransportPassword', 'wrong password' ); $mail = new eZMail(); $mail->setSender( $this->adminEmail, $this->adminName );
Skipped unit tests that relies on stmp.ez.no
ezsystems_ezpublish-legacy
train
php
3bdb79f15eed3f35e79e807b3ca491fc68e1ba49
diff --git a/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/lib/Thelia/Core/Template/Loop/ProductSaleElements.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Core/Template/Loop/ProductSaleElements.php +++ b/lib/Thelia/Core/Template/Loop/ProductSaleElements.php @@ -68,6 +68,7 @@ class ProductSaleElements extends BaseLoop implements PropelSearchLoopInterface, 'quantity', 'quantity_reverse', 'min_price', 'max_price', 'promo', 'new', + 'weight', 'weight_reverse', 'random' ) ) @@ -142,6 +143,12 @@ class ProductSaleElements extends BaseLoop implements PropelSearchLoopInterface, case "new": $search->orderByNewness(Criteria::DESC); break; + case "weight": + $search->orderByWeight(Criteria::ASC); + break; + case "weight_reverse": + $search->orderByWeight(Criteria::DESC); + break; case "random": $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()');
add order by weight in loop product sale elements
thelia_core
train
php
9c9a3e98b7a943fe78a0870420e5371195ecc757
diff --git a/llvmlite/tests/test_ir.py b/llvmlite/tests/test_ir.py index <HASH>..<HASH> 100644 --- a/llvmlite/tests/test_ir.py +++ b/llvmlite/tests/test_ir.py @@ -2066,7 +2066,7 @@ class TestConstant(TestBase): def test_non_nullable_int(self): constant = ir.Constant(ir.IntType(32), None).constant - assert constant == 0 + self.assertEqual(constant, 0) def test_structs(self): st1 = ir.LiteralStructType((flt, int1))
Use unit-test assertions instead of built-in
numba_llvmlite
train
py
74a690ac56d64a7873f9c322ca2b54841d65f40c
diff --git a/scripts/release/mirror.js b/scripts/release/mirror.js index <HASH>..<HASH> 100644 --- a/scripts/release/mirror.js +++ b/scripts/release/mirror.js @@ -366,12 +366,20 @@ const mirrorSupport = (destination, data) => { ); } - if (data[upstream] == 'mirror') { + let upstreamData = data[upstream]; + + if (!upstreamData) { + throw new Error( + `The data for ${upstream} is not defined for mirroring to ${destination}, cannot mirror!`, + ); + } + + if (upstreamData === 'mirror') { // Perform mirroring upstream if needed - data[upstream] = mirrorSupport(upstream, data); + upstreamData = mirrorSupport(upstream, data); } - return bumpSupport(data[upstream], destination); + return bumpSupport(upstreamData, destination); }; export default mirrorSupport;
Don't alter data when performing upstream mirroring (#<I>)
mdn_browser-compat-data
train
js
450c42f166935acd1ebdc39d5c489c1d0439199f
diff --git a/builtin/providers/aws/resource_aws_route53_zone_association.go b/builtin/providers/aws/resource_aws_route53_zone_association.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_route53_zone_association.go +++ b/builtin/providers/aws/resource_aws_route53_zone_association.go @@ -59,7 +59,7 @@ func resourceAwsRoute53ZoneAssociationCreate(d *schema.ResourceData, meta interf } // Store association id - association_id := *resp.ChangeInfo.ID + association_id := cleanChangeID(*resp.ChangeInfo.ID) d.Set("association_id", association_id) d.SetId(association_id)
keep clean changeinfo as res id
hashicorp_terraform
train
go
283de238610596338e66551ecf4c90ee95fbba0d
diff --git a/src/cr/cube/cube.py b/src/cr/cube/cube.py index <HASH>..<HASH> 100644 --- a/src/cr/cube/cube.py +++ b/src/cr/cube/cube.py @@ -1081,13 +1081,6 @@ class _WeightedValidCountsMeasure(_BaseMeasure): """Weighted Valid counts for cube.""" @lazyproperty - def missing_count(self): - """numeric representing count of missing rows reflected in response.""" - return self._cube_dict["result"]["measures"]["valid_count_weighted"].get( - "n_missing", 0 - ) - - @lazyproperty def _flat_values(self): """Optional 1D np.ndarray of np.float64 weighted valid counts.""" valid_counts = (
[#<I>]: remove missing counts from weighted valid count measure in cube
Crunch-io_crunch-cube
train
py
e84af2c0f797bca760c797724c59094be8713b88
diff --git a/lib/Yucca/Component/Selector/Source/Database.php b/lib/Yucca/Component/Selector/Source/Database.php index <HASH>..<HASH> 100644 --- a/lib/Yucca/Component/Selector/Source/Database.php +++ b/lib/Yucca/Component/Selector/Source/Database.php @@ -74,6 +74,9 @@ class Database implements SelectorSourceInterface{ $result = $this->schemaManager->fetchIds($options[SelectorSourceInterface::TABLE], $criterias, $fields, $options[SelectorSourceInterface::FORCE_FROM_MASTER], $options); if (self::RESULT_COUNT === $options[SelectorSourceInterface::RESULT]) { + if(false === is_array($result) || false === is_array(current($result))) { + return 0; + } return current(current($result)); } else { return $result;
[COUNT] Fix bug when counting on a request with group_by
yucca-php_yucca
train
php
52eeead95b38f02f2c622f11803ac1355cdc858b
diff --git a/coconut/icoconut/root.py b/coconut/icoconut/root.py index <HASH>..<HASH> 100644 --- a/coconut/icoconut/root.py +++ b/coconut/icoconut/root.py @@ -37,6 +37,7 @@ class kernel(Kernel): language_version = VERSION banner = "Coconut:" language_info = { + "name": "coconut", "mimetype": "text/x-python", "file_extension": ".coc", "codemirror_mode": "python",
Adds a name field to language_info
evhub_coconut
train
py
d42b44b8ff68ee3975714bb017eff64a159ce733
diff --git a/specs-go/config.go b/specs-go/config.go index <HASH>..<HASH> 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -34,7 +34,7 @@ type Process struct { // Terminal creates an interactive terminal for the container. Terminal bool `json:"terminal,omitempty"` // ConsoleSize specifies the size of the console. - ConsoleSize Box `json:"consoleSize,omitempty"` + ConsoleSize *Box `json:"consoleSize,omitempty"` // User specifies user information for the process. User User `json:"user"` // Args specifies the binary and arguments for the application to execute.
specs-go/config: Use a pointer for Process.ConsoleSize Avoid injecting: "consoleSize":{"height":0,"width":0} when serializing with Go's stock JSON serializer. Using a pointer for this optional struct property works around [1]. [1]: <URL>
opencontainers_runtime-spec
train
go
36126aefc3c9bcb1407b7f8e265e907377c7bccd
diff --git a/worker/instancemutater/worker.go b/worker/instancemutater/worker.go index <HASH>..<HASH> 100644 --- a/worker/instancemutater/worker.go +++ b/worker/instancemutater/worker.go @@ -153,13 +153,11 @@ func newWorker(config Config) (*mutaterWorker, error) { err = catacomb.Invoke(catacomb.Plan{ Site: &w.catacomb, Work: w.loop, + Init: []worker.Worker{watcher}, }) if err != nil { return nil, errors.Trace(err) } - if err := w.catacomb.Add(watcher); err != nil { - return nil, errors.Trace(err) - } return w, nil }
Fix race in catacomb registraion.
juju_juju
train
go
6c794106e7ad9a8a879cc421cce7786ad857f859
diff --git a/slickqa/slickqa.py b/slickqa/slickqa.py index <HASH>..<HASH> 100644 --- a/slickqa/slickqa.py +++ b/slickqa/slickqa.py @@ -25,6 +25,7 @@ def update_result(self): self.connection.results(self).update() def update_testrun(self): + del self.summary self.connection.testruns(self).update() def add_file_to_result(self, filename, fileobj=None):
making sure that the summary never get's updated unintentionally
slickqa_python-client
train
py
f22ee6b411d4f0bb471cc9ea8e9cde0db5c49c96
diff --git a/corelib/time.rb b/corelib/time.rb index <HASH>..<HASH> 100644 --- a/corelib/time.rb +++ b/corelib/time.rb @@ -129,10 +129,6 @@ class Time `new Date()` end - def self.parse(str) - `Date.parse(str)` - end - def +(other) if Time === other raise TypeError, "time + time?" @@ -517,3 +513,14 @@ class Time self end end + +# FIXME: move this to stdlib when the corelib has its own path +class Time + def self.parse(str) + `new Date(Date.parse(str))` + end + + def iso8601 + strftime('%FT%T%z') + end +end
Move Date.parse to the stdlib section and make it compliant
opal_opal
train
rb
f3d962ad6457dee98c3facffe86fd22b46139865
diff --git a/test/e2e/node/runtimeclass.go b/test/e2e/node/runtimeclass.go index <HASH>..<HASH> 100644 --- a/test/e2e/node/runtimeclass.go +++ b/test/e2e/node/runtimeclass.go @@ -58,7 +58,7 @@ var _ = ginkgo.Describe("[sig-node] RuntimeClass", func() { gomega.Expect(apierrs.IsForbidden(err)).To(gomega.BeTrue(), "should be forbidden error") }) - ginkgo.It("should run a Pod requesting a RuntimeClass with scheduling [NodeFeature:RuntimeHandler] ", func() { + ginkgo.It("should run a Pod requesting a RuntimeClass with scheduling [NodeFeature:RuntimeHandler] [Disruptive] ", func() { nodeName := scheduling.GetNodeThatCanRunPod(f) nodeSelector := map[string]string{ "foo": "bar",
tag test that taints a node as disruptive
kubernetes_kubernetes
train
go
678ddd48a518f8d1ae7a9ba6ee7f05c090d00c60
diff --git a/util/svg-sprite.js b/util/svg-sprite.js index <HASH>..<HASH> 100644 --- a/util/svg-sprite.js +++ b/util/svg-sprite.js @@ -3,7 +3,7 @@ // See https://github.com/kisenka/svg-sprite-loader/issues/200 for an issue that // may lead to a cleaner way of customising this. -import BrowserSprite from 'svg-baker-runtime/src/browser-sprite'; +import BrowserSprite from 'svg-baker-runtime/browser-sprite'; import domready from 'domready'; const spriteNodeId = '__SVG_SPRITE_NODE__';
Import dist version of svg-baker-runtime/browser-sprite src version needed transpiling and therefore broke at build time.
cultureamp_cultureamp-style-guide
train
js
24b4741aafa7304e3a94f3bb780d060ea6994119
diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java index <HASH>..<HASH> 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java @@ -149,7 +149,6 @@ public final class CpeMemoryIndex { * * @return the CPE Analyzer. */ - @SuppressWarnings("unchecked") private Analyzer createIndexingAnalyzer() { final Map<String, Analyzer> fieldAnalyzers = new HashMap<String, Analyzer>(); fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer()); @@ -161,7 +160,6 @@ public final class CpeMemoryIndex { * * @return the CPE Analyzer. */ - @SuppressWarnings("unchecked") private Analyzer createSearchingAnalyzer() { final Map<String, Analyzer> fieldAnalyzers = new HashMap<String, Analyzer>(); fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
Removed unnecessary @SuppressWarnings.
jeremylong_DependencyCheck
train
java
edf1c2c7e00e40ed631c59b95df588ebc74fe27c
diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/tunnel/AbstractGuacamoleTunnelService.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/tunnel/AbstractGuacamoleTunnelService.java index <HASH>..<HASH> 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/tunnel/AbstractGuacamoleTunnelService.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/tunnel/AbstractGuacamoleTunnelService.java @@ -529,8 +529,9 @@ public abstract class AbstractGuacamoleTunnelService implements GuacamoleTunnelS } // Ensure connection group is always released if child acquire fails - finally { + catch (GuacamoleException e) { release(user, connectionGroup); + throw e; } // Connect to acquired child
GUAC-<I>: Don't "ALWAYS" release connection groups ... they only need to be released when acquire fails.
glyptodon_guacamole-client
train
java
f86a977322fa45f85e8d8a09d5073059d45eb962
diff --git a/lib/decompress-zip.js b/lib/decompress-zip.js index <HASH>..<HASH> 100644 --- a/lib/decompress-zip.js +++ b/lib/decompress-zip.js @@ -5,7 +5,7 @@ // assertions everywhere to make sure that we are not dealing with a ZIP type // that I haven't designed for. Things like spanning archives, non-DEFLATE // compression, encryption, etc. -var fs = require('fs'); +var fs = require('graceful-fs'); var Q = require('q'); var path = require('path'); var util = require('util'); diff --git a/lib/extractors.js b/lib/extractors.js index <HASH>..<HASH> 100644 --- a/lib/extractors.js +++ b/lib/extractors.js @@ -2,7 +2,7 @@ var stream = require('stream'); if (!stream.Readable) { var stream = require('readable-stream'); } -var fs = require('fs'); +var fs = require('graceful-fs'); var Q = require('q'); var path = require('path'); var zlib = require('zlib'); diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "binary": "~0.3.0", "touch": "0.0.2", "readable-stream": "~1.1.8", - "nopt": "~2.2.0" + "nopt": "~2.2.0", + "graceful-fs": "~2.0.3" } }
Switched to graceful-fs to avoid EMFILE errors
bower_decompress-zip
train
js,js,json
617f7eb88b142f474c89915e63999c52f670362e
diff --git a/lib/lanes/api/sprockets_extension.rb b/lib/lanes/api/sprockets_extension.rb index <HASH>..<HASH> 100644 --- a/lib/lanes/api/sprockets_extension.rb +++ b/lib/lanes/api/sprockets_extension.rb @@ -2,6 +2,7 @@ require 'sprockets' require 'sass' require 'sinatra/sprockets-helpers' require_relative 'javascript_processor' +require 'compass/import-once/activate' module Lanes module API @@ -14,11 +15,11 @@ module Lanes env.cache = ::Sprockets::Cache::FileStore.new(Pathname.pwd.join('tmp','cache')) end end - env.append_path root.join('client') - JsAssetCompiler.register(env) Lanes::Extensions.each do | ext | ext.client_paths.each{ |path| env.append_path(path) } end + env.append_path root.join('client') + JsAssetCompiler.register(env) end def self.registered(app)
Add extensions to sprockets before base
argosity_hippo
train
rb
c73e8f2495c6b51cc6c200468798ad75175de377
diff --git a/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb b/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb index <HASH>..<HASH> 100644 --- a/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb +++ b/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb @@ -65,7 +65,7 @@ describe "Spanner Client", :single_use, :spanner do end results.timestamp.wont_be :nil? - results.timestamp.must_be_close_to timestamp + results.timestamp.must_be_close_to timestamp, 1 end it "runs a read with timestamp option" do @@ -79,7 +79,7 @@ describe "Spanner Client", :single_use, :spanner do end results.timestamp.wont_be :nil? - results.timestamp.must_be_close_to timestamp + results.timestamp.must_be_close_to timestamp, 1 end it "runs a query with staleness option" do
Loosen single-use timestamp asserts, again
googleapis_google-cloud-ruby
train
rb
0109cbbb4391bf63d98765d535afaa50c1193284
diff --git a/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Strings.java b/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Strings.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Strings.java +++ b/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Strings.java @@ -23,10 +23,6 @@ public class Strings { public static final String[] EMPTY_ARRAY = new String[0]; - /** - * @deprecated will be moved to JUnit utilities. - */ - @Deprecated public static boolean equalsIgnoreWhitespace(String left, String right) { String l = left == null ? "" : left.replaceAll("\\s", ""); String r = right == null ? "" : right.replaceAll("\\s", "");
[util] removed 'planned' deprecation.
eclipse_xtext-core
train
java
a49fca44e0328462d23d09c3c3cf682f212de995
diff --git a/mod/assign/renderable.php b/mod/assign/renderable.php index <HASH>..<HASH> 100644 --- a/mod/assign/renderable.php +++ b/mod/assign/renderable.php @@ -788,7 +788,7 @@ class assign_files implements renderable { if (!empty($CFG->enableportfolios)) { require_once($CFG->libdir . '/portfoliolib.php'); - if (count($files) >= 1 && + if (count($files) >= 1 && !empty($sid) && has_capability('mod/assign:exportownsubmission', $this->context)) { $button = new portfolio_add_button(); $callbackparams = array('cmid' => $this->cm->id, @@ -823,6 +823,7 @@ class assign_files implements renderable { foreach ($dir['files'] as $file) { $file->portfoliobutton = ''; if (!empty($CFG->enableportfolios)) { + require_once($CFG->libdir . '/portfoliolib.php'); $button = new portfolio_add_button(); if (has_capability('mod/assign:exportownsubmission', $this->context)) { $portfolioparams = array('cmid' => $this->cm->id, 'fileid' => $file->get_id());
MDL-<I> assign: can't export to portfolio on non-submission
moodle_moodle
train
php
d99e33c6669169f76fa9492a4aaab5790eae789c
diff --git a/dev/com.ibm.ws.kernel.feature_fat/fat/src/com/ibm/ws/kernel/feature/fat/ActivationTypeTest.java b/dev/com.ibm.ws.kernel.feature_fat/fat/src/com/ibm/ws/kernel/feature/fat/ActivationTypeTest.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.kernel.feature_fat/fat/src/com/ibm/ws/kernel/feature/fat/ActivationTypeTest.java +++ b/dev/com.ibm.ws.kernel.feature_fat/fat/src/com/ibm/ws/kernel/feature/fat/ActivationTypeTest.java @@ -40,6 +40,9 @@ public class ActivationTypeTest { // Note that usr/product features are never parallel activated server.setMarkToEndOfLog(); + // Our new server.xml is the same size as the old one, so wait a couple seconds to make + // sure the config runtime will recognize the change. + Thread.sleep(2000); server.changeFeatures(Arrays.asList("usr:test.activation.parallel.user-1.0")); server.waitForConfigUpdateInLogUsingMark(Collections.<String> emptySet()); server.waitForStringInLogUsingMark("test.activation.type.parallel.user: false");
Add small wait to make sure server.xml change is recognized
OpenLiberty_open-liberty
train
java
96c037965b117d55f5bd5adf984a47d083b2a7bd
diff --git a/src/helpers/ImgixHelpers.php b/src/helpers/ImgixHelpers.php index <HASH>..<HASH> 100644 --- a/src/helpers/ImgixHelpers.php +++ b/src/helpers/ImgixHelpers.php @@ -42,7 +42,7 @@ class ImgixHelpers } if (($config->useCloudSourcePath === true) && isset($volume->subfolder) && \get_class($volume) !== 'craft\volumes\Local') { - $path = implode('/', [$volume->subfolder, $image->getPath()]); + $path = implode('/', [\Craft::parseEnv($volume->subfolder), $image->getPath()]); } else { $path = $image->getPath(); }
Adds environment parsing to volume subfolder setting.
aelvan_Imager-Craft
train
php
4a11b5dc1c5a2b0d9c35b200abc2155fedb82cba
diff --git a/spec/DigitalOceanV2/Adapter/BuzzAdapterSpec.php b/spec/DigitalOceanV2/Adapter/BuzzAdapterSpec.php index <HASH>..<HASH> 100644 --- a/spec/DigitalOceanV2/Adapter/BuzzAdapterSpec.php +++ b/spec/DigitalOceanV2/Adapter/BuzzAdapterSpec.php @@ -3,16 +3,17 @@ namespace spec\DigitalOceanV2\Adapter; use Buzz\Browser; +use Buzz\Listener\ListenerInterface; use Buzz\Message\Response; use DigitalOceanV2\Adapter\BuzzOAuthListener; class BuzzAdapterSpec extends \PhpSpec\ObjectBehavior { - function let(Browser $browser, Response $response) + function let(Browser $browser, Response $response, ListenerInterface $listener) { - $browser->addListener(new BuzzOAuthListener('my_access_token'))->shouldBeCalled(); + $browser->addListener($listener)->shouldBeCalled(); - $this->beConstructedWith('my_access_token', $browser); + $this->beConstructedWith('my_access_token', $browser, $listener); } function it_is_initializable()
fix buzz adapter spec which can use custom listener
toin0u_DigitalOceanV2
train
php
f9b4bc0ffcfbe0bedead9422b82fad061abde7a7
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/conversion/XbaseValueConverterService.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/conversion/XbaseValueConverterService.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/conversion/XbaseValueConverterService.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/conversion/XbaseValueConverterService.java @@ -37,6 +37,11 @@ public class XbaseValueConverterService extends DefaultTerminalConverters { @Inject private Provider<KeywordBasedValueConverter> keywordBasedConverterProvider; + @ValueConverter(rule = "IdOrSuper") + public IValueConverter<String> getIdOrSuperValueConverter() { + return ID(); + } + @ValueConverter(rule = "QualifiedName") public IValueConverter<String> getQualifiedNameValueConverter() { return qualifiedNameValueConverter;
[Xbase] registered ID value converter for IdOrSuper rule
eclipse_xtext-extras
train
java
ecb26e9eec76ff7415b4fcc7b072a58f8469c87c
diff --git a/zipline/test_algorithms.py b/zipline/test_algorithms.py index <HASH>..<HASH> 100644 --- a/zipline/test_algorithms.py +++ b/zipline/test_algorithms.py @@ -299,7 +299,7 @@ class BatchTransformAlgorithm(TradingAlgorithm): fillna=False ) - self.return_nan = ReturnPriceBatchTransform( + self.return_nan = return_price_batch_decorator( refresh_period=self.refresh_period, window_length=self.window_length, fillna=True
BUG: Can not test for length when dropping nans.
quantopian_zipline
train
py
56374d7c51a289f37e83f457563c0f2bcd67d2fd
diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/authoring/tracks/CencEncryptingTrackImpl.java b/isoparser/src/main/java/com/googlecode/mp4parser/authoring/tracks/CencEncryptingTrackImpl.java index <HASH>..<HASH> 100644 --- a/isoparser/src/main/java/com/googlecode/mp4parser/authoring/tracks/CencEncryptingTrackImpl.java +++ b/isoparser/src/main/java/com/googlecode/mp4parser/authoring/tracks/CencEncryptingTrackImpl.java @@ -49,7 +49,7 @@ public class CencEncryptingTrackImpl implements CencEncyprtedTrack { List<Sample> origSamples = source.getSamples(); if (cencSampleAuxiliaryData == null) { - this.cencSampleAuxiliaryData = cencSampleAuxiliaryData = new LinkedList<CencSampleAuxiliaryDataFormat>(); + this.cencSampleAuxiliaryData = cencSampleAuxiliaryData = new ArrayList<CencSampleAuxiliaryDataFormat>(); BigInteger one = new BigInteger("1"); byte[] init = new byte[]{};
removed linkedlist in favor of arraylist
sannies_mp4parser
train
java
82586e064b400a6fab43e72aed446839cb6f003a
diff --git a/lxd/storage/drivers/driver_zfs_volumes.go b/lxd/storage/drivers/driver_zfs_volumes.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/driver_zfs_volumes.go +++ b/lxd/storage/drivers/driver_zfs_volumes.go @@ -940,7 +940,8 @@ func (d *zfs) SetVolumeQuota(vol Volume, size string, op *operations.Operation) // Block image volumes cannot be resized because they have a readonly snapshot that doesn't get // updated when the volume's size is changed, and this is what instances are created from. - if vol.volType == VolumeTypeImage { + // During initial volume fill allowUnsafeResize is enabled because snapshot hasn't been taken yet. + if !vol.allowUnsafeResize && vol.volType == VolumeTypeImage { return ErrNotSupported }
lxd/storage/drivers/driver/zfs/volume: Allow image resize when in unsafe mode in SetVolumeQuota
lxc_lxd
train
go
4960e1569f6b4ed76d4b3fdcbbf747c2264e71e2
diff --git a/test/test-yaml.rb b/test/test-yaml.rb index <HASH>..<HASH> 100644 --- a/test/test-yaml.rb +++ b/test/test-yaml.rb @@ -1,3 +1,4 @@ +require 'yaml' require_relative '../lib/grayskull/formats/yaml_handler' require_relative '../lib/grayskull/formats' require_relative '../lib/grayskull/validator' @@ -5,7 +6,7 @@ require_relative '../lib/grayskull/validator' path = File.expand_path(File.join(File.dirname(__FILE__), "yaml/file.yml")) schema = File.expand_path(File.join(File.dirname(__FILE__), "yaml/schema.yml")) +yaml = YAML.load(path) +validator = Grayskull::Validator.new(yaml,schema) -validator = Grayskull::Validator.new(path,schema) - -validator.validate +puts validator.validate
Added test for passing preloaded data
OiNutter_grayskull
train
rb
7876b4f592d2fcc3e89256c51099f63b518e15c9
diff --git a/go/kbfs/libkbfs/folder_branch_ops.go b/go/kbfs/libkbfs/folder_branch_ops.go index <HASH>..<HASH> 100644 --- a/go/kbfs/libkbfs/folder_branch_ops.go +++ b/go/kbfs/libkbfs/folder_branch_ops.go @@ -741,7 +741,7 @@ func (fbo *folderBranchOps) clearConflictView(ctx context.Context) ( fbo.log.CDebugf(ctx, "Clearing conflict view") defer func() { - fbo.log.CDebugf(ctx, "Done with clearConflictView: %+v", err) + fbo.deferLog.CDebugf(ctx, "Done with clearConflictView: %+v", err) }() lState := makeFBOLockState() @@ -8327,7 +8327,8 @@ func (fbo *folderBranchOps) MigrateToImplicitTeam( fbo.log.CDebugf(ctx, "Starting migration of TLF %s", id) defer func() { - fbo.log.CDebugf(ctx, "Finished migration of TLF %s, err=%+v", id, err) + fbo.deferLog.CDebugf( + ctx, "Finished migration of TLF %s, err=%+v", id, err) }() if id.Type() != tlf.Private && id.Type() != tlf.Public {
folder_branch_ops: use `deferLog` in deferred logs To get better line number reporting in the logs.
keybase_client
train
go
4b7386350821543a28c475ce5828af2c58be6071
diff --git a/src/math/matrix2.js b/src/math/matrix2.js index <HASH>..<HASH> 100644 --- a/src/math/matrix2.js +++ b/src/math/matrix2.js @@ -20,13 +20,13 @@ /** @scope me.Matrix2d.prototype */ { /** @ignore */ - init : function (a, b, c, d, e, f, g, h, i) { + init : function () { this.val = new Float32Array(9); - if (a instanceof me.Matrix2d) { - this.copy(a); + if (arguments.length && arguments[0] instanceof me.Matrix2d) { + this.copy(arguments[0]); } else if (arguments.length >= 6) { - this.setTransform(a, b, c, d, e, f, g, h, i); + this.setTransform.apply(this, arguments); } else { this.identity();
this is working better, as undefined arguments would be considered "present" then by the setTransform function
melonjs_melonJS
train
js
90fa5bc5db33020d4ec70fe5901ad6a4704992ae
diff --git a/component.js b/component.js index <HASH>..<HASH> 100644 --- a/component.js +++ b/component.js @@ -3,7 +3,20 @@ // they are responsible for calling render on those elements Mast.Component = { - + /** + * attributes: properties to be added directly to the component + * i.e. accessible from component as: + * this.someThing + * this.someThingElse + * + * modelAttributes: properties to be added directly to the component's Model + * i.e. accessible from component as: + * this.get('someThing') + * this.get('someThingElse') + * + * dontRender: whether or not to render this component when it is instantiated + * default: false + */ initialize: function(attributes,modelAttributes,dontRender){ // Bind context @@ -166,7 +179,7 @@ Mast.Component = // Instantiate subcomponent, but don't append/render it yet - var subcomponent = new Subcomponent(plist); + var subcomponent = new Subcomponent(plist,plist); this.children[key] = subcomponent; },
Documentation that was added via balderdash, and the fix to make subcomponents pass down properties properly.
balderdashy_mast
train
js