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
e9132c446f1d6e68625ece74f1a3653c2bb3495e
diff --git a/code/models/DocumentationEntity.php b/code/models/DocumentationEntity.php index <HASH>..<HASH> 100755 --- a/code/models/DocumentationEntity.php +++ b/code/models/DocumentationEntity.php @@ -260,4 +260,17 @@ class DocumentationEntity extends ViewableData { public function compare(DocumentationEntity $other) { return version_compare($this->getVersion(), $other->getVersion()); } + + /** + * @return array + */ + public function toMap() { + return array( + 'Key' => $this->key, + 'Path' => $this->getPath(), + 'Version' => $this->getVersion(), + 'IsStable' => $this->getIsStable(), + 'Language' => $this->getLanguage() + ); + } } \ No newline at end of file
Add DocumentationEntity::toMap() for assert compability
silverstripe_silverstripe-docsviewer
train
php
4ccd031e266ed491528b7cd279889e60e4c78684
diff --git a/lib/kondate/cli.rb b/lib/kondate/cli.rb index <HASH>..<HASH> 100644 --- a/lib/kondate/cli.rb +++ b/lib/kondate/cli.rb @@ -137,7 +137,7 @@ module Kondate env['RUBYOPT'] = "-I #{Config.plugin_dir} -r bundler/setup -r ext/itamae/kondate" property_files.each do |role, property_file| next if property_file.empty? - command = "bundle exec itamae ssh" + command = "itamae ssh" command << " -h #{host}" properties = property_file.load @@ -185,7 +185,7 @@ module Kondate env['TARGET_HOST'] = host env['TARGET_NODE_FILE'] = property_file.path - command = "bundle exec rspec #{spec_files.map{|f| f.shellescape }.join(' ')}" + command = "rspec #{spec_files.map{|f| f.shellescape }.join(' ')}" $stdout.puts "env #{env.map {|k, v| "#{k}=#{v.shellescape}" }.join(' ')} #{command}" return false unless system(env, command)
bundler exec inside bundle exec makes troubles
sonots_kondate
train
rb
21b9f1624333505a35a85607f13b14002bcc28a6
diff --git a/service/server/host/src/main/java/com/emc/pravega/service/server/host/selftest/Actor.java b/service/server/host/src/main/java/com/emc/pravega/service/server/host/selftest/Actor.java index <HASH>..<HASH> 100644 --- a/service/server/host/src/main/java/com/emc/pravega/service/server/host/selftest/Actor.java +++ b/service/server/host/src/main/java/com/emc/pravega/service/server/host/selftest/Actor.java @@ -115,7 +115,7 @@ abstract class Actor extends AbstractService implements AutoCloseable { } catch (Throwable ex) { ex = ExceptionHelpers.getRealException(ex); if (failureCause != null) { - TestLogger.log(getLogId(), "Original Failure (%s).", failureCause); + TestLogger.log(getLogId(), "Original Failure: %s.", failureCause); failureCause.printStackTrace(); failureCause = ex; } @@ -125,7 +125,7 @@ abstract class Actor extends AbstractService implements AutoCloseable { if (failureCause == null) { notifyStopped(); } else { - TestLogger.log(getLogId(), "Failed (%s).", failureCause); + TestLogger.log(getLogId(), "Failed: %s.", failureCause); notifyFailed(failureCause); } });
Update Actor.java (almost) no-op commit to try to trigger build.
pravega_pravega
train
java
61100d040b73dbff828b105f01de38ff7aa774ed
diff --git a/examples/mongodb/model.js b/examples/mongodb/model.js index <HASH>..<HASH> 100755 --- a/examples/mongodb/model.js +++ b/examples/mongodb/model.js @@ -108,7 +108,10 @@ model.saveAccessToken = function (token, clientId, expires, userId, callback) { model.getUser = function (username, password, callback) { console.log('in getUser (username: ' + username + ', password: ' + password + ')'); - OAuthUsersModel.findOne({ username: username, password: password }, callback); + OAuthUsersModel.findOne({ username: username, password: password }, function(err, user) { + if(err) return callback(err); + callback(null, user._id); + }); }; /*
Fix in mongo model.getUser to only return the _id. Prevents full user object from being assigned to userId parameter in save methods. Style changes to conform with module standards. Adding return.
oauthjs_node-oauth2-server
train
js
35ffa0eeeb149a962aaa5271d1698c5ad6aaeeaf
diff --git a/src/CartSubItem.php b/src/CartSubItem.php index <HASH>..<HASH> 100644 --- a/src/CartSubItem.php +++ b/src/CartSubItem.php @@ -17,7 +17,6 @@ class CartSubItem public $locale; - public $items = []; public $internationalFormat; private $itemHash; @@ -54,8 +53,8 @@ class CartSubItem { $price = $this->price; - if(isset($this->options['items'])) { - foreach ($this->options['items'] as $item) { + if(isset($this->items)) { + foreach ($this->items as $item) { $price += $item->getPrice(false, false) + $item->subItemsTotal(false, false); } }
removing no used public varabiel
lukepolo_laracart
train
php
d88fe6d37732666da2786d07c5283644e3167bd7
diff --git a/lib/kaminari/models/active_record_extension.rb b/lib/kaminari/models/active_record_extension.rb index <HASH>..<HASH> 100644 --- a/lib/kaminari/models/active_record_extension.rb +++ b/lib/kaminari/models/active_record_extension.rb @@ -18,7 +18,7 @@ module Kaminari include Kaminari::ActiveRecordRelationMethods include Kaminari::PageScopeMethods end - end + end if kls.superclass == ActiveRecord::Base end end end
Only add extensions to direct descendents of ActiveRecord::Base
kaminari_kaminari
train
rb
bb962c1ca4961d92c1c728a3ece379666a850913
diff --git a/fireplace/entity.py b/fireplace/entity.py index <HASH>..<HASH> 100644 --- a/fireplace/entity.py +++ b/fireplace/entity.py @@ -97,7 +97,7 @@ class BuffableEntity(BaseEntity): def clear_buffs(self): if self.buffs: self.log("Clearing buffs from %r", self) - for buff in self.buffs: + for buff in self.buffs[:]: buff.destroy() diff --git a/tests/test_mechanics.py b/tests/test_mechanics.py index <HASH>..<HASH> 100644 --- a/tests/test_mechanics.py +++ b/tests/test_mechanics.py @@ -594,6 +594,20 @@ def test_silence_deathrattle(): assert len(game.player1.field) == 0 +def test_silence_multiple_buffs(): + game = prepare_game() + wisp = game.player1.give(WISP) + wisp.play() + assert wisp.atk == 1 + # Play Blessing of Might (+3 attack) twice + game.player1.give("CS2_087").play(target=wisp) + assert wisp.atk == 1 + 3 + game.player1.give("CS2_087").play(target=wisp) + assert wisp.atk == 1 + 3 + 3 + game.player1.give(SILENCE).play(target=wisp) + assert wisp.atk == 1 + + def test_spell_power(): game = prepare_game(HUNTER, HUNTER)
Ensure multiple buffs are always removed on entity.clear_buffs() Previously we would remove buffs from the buff list while iterating over it. This could lead to premature termination of the loop and failure to destroy all buffs.
jleclanche_fireplace
train
py,py
ffea38ecad93e50324aa7784b1154ffadea88cb9
diff --git a/provider/openstack/provider.go b/provider/openstack/provider.go index <HASH>..<HASH> 100644 --- a/provider/openstack/provider.go +++ b/provider/openstack/provider.go @@ -2343,3 +2343,10 @@ func (*Environ) AreSpacesRoutable(ctx context.ProviderCallContext, space1, space func (*Environ) SSHAddresses(ctx context.ProviderCallContext, addresses corenetwork.SpaceAddresses) (corenetwork.SpaceAddresses, error) { return addresses, nil } + +// SupportsRulesWithIPV6CIDRs returns true if the environment supports ingress +// rules containing IPV6 CIDRs. It is part of the FirewallFeatureQuerier +// interface. +func (e *Environ) SupportsRulesWithIPV6CIDRs(ctx context.ProviderCallContext) (bool, error) { + return true, nil +}
Implement FirewallFeatureQuerier for the openstack provider Openstack supports IPV6 CIDRs for firewall ingress rules. To this end, this commit implements SupportsRulesWithIPV6CIDRs for the openstack provider.
juju_juju
train
go
e40245aac96cdc757532abc21a26d04795918d6d
diff --git a/cmem.js b/cmem.js index <HASH>..<HASH> 100644 --- a/cmem.js +++ b/cmem.js @@ -11,7 +11,8 @@ function create() { clear: { value: clear }, unit: { value: unit }, iterator: { value: iterator }, - memos: { value: [] } + memos: { value: [] }, + noop: { value: _silent } }); return cmem;
Added silent function to API as come.noop
neytema_cmem
train
js
dd092f6c2bb68e830be001f8cf1472fc15e8ab4a
diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index <HASH>..<HASH> 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -135,7 +135,8 @@ func StartGateway(ctx *cli.Context, gw Gateway) { handleCommonCmdArgs(ctx) // Get port to listen on from gateway address - _, gatewayPort, pErr := net.SplitHostPort(gatewayAddr) + var pErr error + _, globalMinioPort, pErr = net.SplitHostPort(gatewayAddr) if pErr != nil { logger.FatalIf(pErr, "Unable to start gateway") } @@ -144,7 +145,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) { // to IPv6 address ie minio will start listening on IPv6 address whereas another // (non-)minio process is listening on IPv4 of given port. // To avoid this error situation we check for port availability. - logger.FatalIf(checkPortAvailability(gatewayPort), "Unable to start the gateway") + logger.FatalIf(checkPortAvailability(globalMinioPort), "Unable to start the gateway") // Create certs path. logger.FatalIf(createConfigDir(), "Unable to create configuration directories")
gateway: Properly set globalMinioPort (#<I>) globalMinioPort is used in federation which stores the address and the port number of the server hosting the specified bucket, this latter uses globalMinioPort but this latter is not set in startup of the gateway mode. This commit fixes the behavior.
minio_minio
train
go
cb62c816726cbe7e1d1544c8e3ee60ec4e401b19
diff --git a/src/Fields/TextField.php b/src/Fields/TextField.php index <HASH>..<HASH> 100644 --- a/src/Fields/TextField.php +++ b/src/Fields/TextField.php @@ -22,11 +22,6 @@ class TextField extends AbstractField return $this; } - public function make(): FieldInterface - { - return (new TextField($this->getName()))->getValue(); - } - public function getTypeDefinition(): array { $properties = parent::getTypeDefinition();
Remove nonfunctional and unnecessary text field factory method
ethanhann_redisearch-php
train
php
6782045cc33e97cf595b9ba5b83f27d61dfd9248
diff --git a/jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/MatchChunk.java b/jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/MatchChunk.java index <HASH>..<HASH> 100644 --- a/jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/MatchChunk.java +++ b/jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/MatchChunk.java @@ -57,7 +57,7 @@ public class MatchChunk extends SqlChunk { } int eq = expression.indexOf('='); if (eq == -1) { - throw new DbSqlBuilderException("Template syntax error, expected 'match' equality: {tableRef=objectRef}."); + throw new DbSqlBuilderException("Syntax error, expected 'match' equality: {tableRef=objectRef}."); } tableRef = expression.substring(0, eq).trim(); objectRef = expression.substring(eq + 1, lastNdx).trim(); @@ -97,6 +97,12 @@ public class MatchChunk extends SqlChunk { continue; } } + // special case for strings + if (value instanceof CharSequence) { + if (StringUtil.isBlank((CharSequence) value)) { + continue; + } + } } if (count > 0) { out.append(AND);
added special case for ignoring blank strings
oblac_jodd
train
java
e6ce1b7beec09a653b4745b57b1b90d2802bb0fc
diff --git a/rapidoid-gui/src/main/java/org/rapidoid/gui/KVGrid.java b/rapidoid-gui/src/main/java/org/rapidoid/gui/KVGrid.java index <HASH>..<HASH> 100644 --- a/rapidoid-gui/src/main/java/org/rapidoid/gui/KVGrid.java +++ b/rapidoid-gui/src/main/java/org/rapidoid/gui/KVGrid.java @@ -60,7 +60,8 @@ public class KVGrid extends AbstractWidget { val = Lmbd.eval(valueView, val); } - tbl = tbl.append(tr(td(key), td(val))); + Tag tr = val != null ? tr(td(key), td(val)) : tr(td(key).colspan("2")); + tbl = tbl.append(tr); } return tbl;
Generating full rows in KVGrid from map entries with null value.
rapidoid_rapidoid
train
java
a3d2cc9a2c63187898b618e40acbc3f19fda3659
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -118,6 +118,11 @@ class Embark { }); }); + engine.events.on('outputDone', function () { + engine.logger.info("Looking for documentation? You can find it at ".cyan + "http://embark.readthedocs.io/".green.underline + ".".cyan); + engine.logger.info("Ready".underline); + }); + engine.deployManager.deployContracts(function (err) { engine.startService("fileWatcher"); if (options.runWebserver) { @@ -136,8 +141,6 @@ class Embark { } else { engine.events.emit('firstDeploymentDone'); engine.events.emit("status", "Ready".green); - engine.logger.info("Looking for documentation? you can find it at ".cyan + "http://embark.readthedocs.io/".green.underline); - engine.logger.info("Ready".underline); let size = windowSize.get(); if (size.height < 40 || size.width < 118) { @@ -249,7 +252,6 @@ class Embark { resetCmd(); } - // TODO: should deploy if it hasn't already upload(platform, options) { options.buildDir = 'dist/';
Moved console "ready" message to write after outputDone event is emitted
embark-framework_embark
train
js
6b8ed19f09439a1d8af9129143ebf96a4c3b8774
diff --git a/bridge.go b/bridge.go index <HASH>..<HASH> 100644 --- a/bridge.go +++ b/bridge.go @@ -221,10 +221,15 @@ func (bridge *Bridge) GetAllLights() ([]Light, error) { for index := 1; index < 101; index++ { light, err := bridge.GetLightByIndex(index) if err != nil { - break + break // Final light index reached, index does not exist. } lights = append(lights, light) } + if len(lights) == 0 { + err := errors.New("Error: No lights found by GetAllLights.") + log.Println(err) + return lights, err + } return lights, nil }
Implemented error catching on GetAllLights if no lights are found.
Collinux_gohue
train
go
9a2e1ee2abfeb9e453ca4309c27c0a58aec364d9
diff --git a/lib/oneview-sdk/resource/api200/volume.rb b/lib/oneview-sdk/resource/api200/volume.rb index <HASH>..<HASH> 100644 --- a/lib/oneview-sdk/resource/api200/volume.rb +++ b/lib/oneview-sdk/resource/api200/volume.rb @@ -123,7 +123,8 @@ module OneviewSDK # @return [true] if snapshot was created successfully def delete_snapshot(name) result = get_snapshot(name) - response = @client.rest_delete(result['uri'], { 'If-Match' => @data['eTag'] }, @api_version) + puts "hi" + response = @client.rest_delete(result['uri'], { 'If-Match' => result['eTag'] }, @api_version) @client.response_handler(response) true end
Snapshot delete fix with correct etags
HewlettPackard_oneview-sdk-ruby
train
rb
2524b95d504b8e85b45ae33b8c2bb22ae1873201
diff --git a/source/node/Entry.js b/source/node/Entry.js index <HASH>..<HASH> 100644 --- a/source/node/Entry.js +++ b/source/node/Entry.js @@ -226,7 +226,6 @@ class Entry { } const raw = this._getRemoteObject().properties; - var result = []; if (!(propertyExpression instanceof RegExp)) { propertyExpression = new RegExp(propertyExpression);
Remove unused var added in PR#<I>
buttercup_buttercup-core
train
js
170ceb2ca99bbb81f44bada362e79169b9be1644
diff --git a/src/org/zaproxy/zap/extension/dynssl/ExtensionDynSSL.java b/src/org/zaproxy/zap/extension/dynssl/ExtensionDynSSL.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/extension/dynssl/ExtensionDynSSL.java +++ b/src/org/zaproxy/zap/extension/dynssl/ExtensionDynSSL.java @@ -73,7 +73,7 @@ public class ExtensionDynSSL extends ExtensionAdaptor { try { createNewRootCa(); } catch (Exception e) { - logger.error(e.getMessage(), e); + logger.error("Failed to create new root CA certificate:", e); } } }).start(); @@ -92,10 +92,11 @@ public class ExtensionDynSSL extends ExtensionAdaptor { } public void createNewRootCa() throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException { - logger.info("Creating new root CA"); + logger.info("Creating new root CA certificate"); KeyStore newrootca = SslCertificateUtils.createRootCA(); setRootCa(newrootca); getParams().setRootca(newrootca); + logger.info("New root CA certificate created"); } private DynamicSSLPanel getOptionsPanel() {
Log that the root CA certificate was created The creation of root CA certificate, if successful, just logs "Creating new root CA", which is very misleading giving the impression that ZAP hanged, as reported in #<I>. With the change it always logs something either that it was created or, if something went wrong, the exception. Tweak existing log messages to include "certificate", also change log of the exception to explicitly say that the creation of root CA certificate failed.
zaproxy_zaproxy
train
java
b315c1d8f557230cb11fa39b0e887519661f0af0
diff --git a/ffn/core.py b/ffn/core.py index <HASH>..<HASH> 100644 --- a/ffn/core.py +++ b/ffn/core.py @@ -858,6 +858,16 @@ class GroupStats(dict): def plot_correlation(self, period='m', title=None, figsize=(12, 6), **kwargs): + """ + Utility function to plot correlations. + + Args: + * period (str): Pandas offset alias string + * title (str): Plot title + * figsize (tuple (x,y)): figure size + * kwargs: passed to Pandas' plot_corr_heatmap function + + """ if title is None: title = '%s return correlation matrix' % get_period_name(period)
added doctring for plot_correlation
pmorissette_ffn
train
py
0a84ab2c11f65d5a4e7a941882578b689329e421
diff --git a/cnab240/errors.py b/cnab240/errors.py index <HASH>..<HASH> 100644 --- a/cnab240/errors.py +++ b/cnab240/errors.py @@ -11,7 +11,7 @@ class AtribuicaoCampoError(Cnab240Error): def __init__(self, campo, valor): self.campo = campo self.valor = valor - super(AtribuicaoCampoError, self).__init__(self) + super(AtribuicaoCampoError, self).__init__() def __unicode__(self): return u'campo:{0} formato:{1} decimais:{2} digitos:{3} - valor:{4}'.\ @@ -41,7 +41,7 @@ class FaltandoArgsError(Cnab240Error): def __init__(self, args_faltantes): self.args_faltantes = args_faltantes - super(FaltandoArgsError, self).__init__(self) + super(FaltandoArgsError, self).__init__() def __unicode__(self): return (u'Os seguintes kwargs sao obrigatorios e nao foram '
Avoid recursion error when trying to print TipoError exception
Trust-Code_python-cnab
train
py
ef42021f8f18252a7c2ebffe8952da8c4cf66cfd
diff --git a/builder/parallels/common/step_test.go b/builder/parallels/common/step_test.go index <HASH>..<HASH> 100644 --- a/builder/parallels/common/step_test.go +++ b/builder/parallels/common/step_test.go @@ -9,6 +9,7 @@ import ( func testState(t *testing.T) multistep.StateBag { state := new(multistep.BasicStateBag) + state.Put("debug", false) state.Put("driver", new(DriverMock)) state.Put("ui", &packer.BasicUi{ Reader: new(bytes.Buffer),
Fix unit tests, broken in #<I>. (#<I>)
hashicorp_packer
train
go
2ea2c401ddc8be3145accb189b27ca1b623fc4e7
diff --git a/lib/wlang/version.rb b/lib/wlang/version.rb index <HASH>..<HASH> 100644 --- a/lib/wlang/version.rb +++ b/lib/wlang/version.rb @@ -3,7 +3,7 @@ module WLang MAJOR = 3 MINOR = 0 - TINY = 0 + TINY = 1 def self.to_s [ MAJOR, MINOR, TINY ].join('.')
Bump to <I> and release.
blambeau_wlang
train
rb
ae5f9decabff85964e5ec625c6a32e75d2bb6e1d
diff --git a/src/Validation/UploadValidator.php b/src/Validation/UploadValidator.php index <HASH>..<HASH> 100644 --- a/src/Validation/UploadValidator.php +++ b/src/Validation/UploadValidator.php @@ -34,7 +34,7 @@ class UploadValidator extends Validator { * * @var string */ - protected $_fileSize = 0; + protected $_filesize = 0; /** * Upload error message. @@ -89,8 +89,8 @@ class UploadValidator extends Validator { * @return boolean */ public function fileSize($value, $size, $operator = '>') { - $this->_fileSize = $value['size']; - return $this->_validateSize($value['size'], $operator, $size); + $this->_filesize = $value['size']; + return Validation::fileSize($value, $operator, $size); } /**
#<I> Fixing the file size validation.
burzum_cakephp-file-storage
train
php
2a0487b6f5af864a07d2b2ae4931ea117f8af136
diff --git a/type_converter/TypeConverter.php b/type_converter/TypeConverter.php index <HASH>..<HASH> 100644 --- a/type_converter/TypeConverter.php +++ b/type_converter/TypeConverter.php @@ -384,7 +384,7 @@ class TypeConverter { $xml = @simplexml_load_string($xml); } - if ($xml->count() <= 0) { + if (count($xml->children()) <= 0) { return (string)$xml; } @@ -408,7 +408,7 @@ class TypeConverter { 'value' => (string)$node ); - if ($node->count() > 0) { + if (count($node->children()) > 0) { $data['value'] = self::xmlToArray($node, $format); } @@ -420,7 +420,7 @@ class TypeConverter { case self::XML_MERGE: case self::XML_OVERWRITE: if ($format == self::XML_MERGE) { - if ($node->count() > 0) { + if (count($node->children()) > 0) { $data = $data + self::xmlToArray($node, $format); } else { $data['value'] = (string)$node;
Updated to support PHP <I>
milesj_type-converter
train
php
ea5d51400820585a6d31011e1a1109c5a1213360
diff --git a/src/event.js b/src/event.js index <HASH>..<HASH> 100644 --- a/src/event.js +++ b/src/event.js @@ -778,9 +778,11 @@ jQuery.each(["bind", "one"], function( i, name ) { jQuery( this ).unbind( event, handler ); return fn.apply( this, arguments ); }) : fn; - return type === "unload" ? this.one(type, data, handler, thisObject) : this.each(function() { - jQuery.event.add( this, type, handler, data ); - }); + return type === "unload" && name !== "one" ? + this.one( type, data, fn, thisObject ) : + this.each(function() { + jQuery.event.add( this, type, handler, data ); + }); }; });
When .bind('unload') was called it accidentally went recursive, from 1bac<I>b6c<I>ab4bcfc<I>b0d<I>c<I>dd<I>. Fixes #<I>.
jquery_jquery
train
js
1818a37f2a0388a39645efb54aa06540e03d4bda
diff --git a/lib/xhive/widgify.rb b/lib/xhive/widgify.rb index <HASH>..<HASH> 100644 --- a/lib/xhive/widgify.rb +++ b/lib/xhive/widgify.rb @@ -28,13 +28,19 @@ module Xhive end def normalized_routes - routes = Rails.application.routes.routes.to_a | Xhive::Engine.routes.routes.to_a + load_routes_for(Rails.application.routes) | load_routes_for(Xhive::Engine.routes) + end + + def load_routes_for(router) + # TODO: find another way to get the routes prefix. This might get changed as is not public API. + mount_point = router._generate_prefix({}).to_s + routes = router.routes.to_a routes.collect do |route| if route.requirements[:controller] && route.requirements[:action] controller = route.requirements[:controller].gsub(/rails\/|xhive\//, '') action = route.requirements[:action] path = route.path.spec.to_s - { :end_point => "#{controller}##{action}", :path => path } + { :end_point => "#{controller}##{action}", :path => "#{mount_point}#{path}" } end end.compact end
Changes to how the routes are built
frozeek_xhive
train
rb
e2ead8535c1490668337b7824e1c9bc84bf8d903
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,6 +14,12 @@ */ module.exports = function (grunt) { + // One may filter tests to be run; useful for debugging. + // Usage (any regexp should do): + // grunt jasmine_node --grep=load_plugin + // grunt jasmine_node --grep="(event.*|config)" + var grep = grunt.option('grep') || ""; + grunt.initConfig({ jshint: { all : ['package.json', 'grunt.js', 'lib/**/*.js', 'spec/**/*.spec.js', '!lib/**/html5shiv.js'], @@ -27,6 +33,7 @@ module.exports = function (grunt) { tasks: ['dev'] }, jasmine_node: { + match : grep + ".", // "." is the default forceExit: true }, beautify: {
Filter tests to be run by jasmine Possibility to filter which attester specs should run; useful for debugging attester. Usage: grunt jasmine_node --grep=<pattern> Close #<I>.
attester_attester
train
js
787d1cd84d26c34d5b8c4583ca75402dd1229e14
diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index <HASH>..<HASH> 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -55,6 +55,11 @@ export default function connectTraceToPlot(WrappedComponent) { }; this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace)); this.name = fullTrace.name; + + const DEFAULT_FIN_CHART_TRACE_NAME = '- increasing'; + if (fullTrace.name.indexOf(DEFAULT_FIN_CHART_TRACE_NAME) && !trace.name) { + this.name = fullTrace.name.replace(DEFAULT_FIN_CHART_TRACE_NAME, ''); + } } getChildContext() {
Remove the additional plotly.js '- increasing' label from trace names if no trace.name was set by user
plotly_react-chart-editor
train
js
c12d86580b831f15ab09cd7f9a77dc111686e95b
diff --git a/providers/providers_test.go b/providers/providers_test.go index <HASH>..<HASH> 100644 --- a/providers/providers_test.go +++ b/providers/providers_test.go @@ -206,3 +206,26 @@ func TestLargeProvidersSet(t *testing.T) { } //*/ + +func TestUponCacheMissProvidersAreReadFromDatastore(t *testing.T) { + old := lruCacheSize + lruCacheSize = 1 + defer func() { lruCacheSize = old }() + ctx := context.Background() + + p1, p2 := peer.ID("a"), peer.ID("b") + c1 := cid.NewCidV1(cid.CBOR, u.Hash([]byte("1"))) + c2 := cid.NewCidV1(cid.CBOR, u.Hash([]byte("2"))) + pm := NewProviderManager(ctx, p1, ds.NewMapDatastore()) + + pm.AddProvider(ctx, c1, p1) + // make the cached provider for c1 go to datastore + pm.AddProvider(ctx, c2, p1) + // now just offloaded record should be brought back and joined with p2 + pm.AddProvider(ctx, c1, p2) + + c1Provs := pm.GetProviders(ctx, c1) + if len(c1Provs) != 2 { + t.Fatalf("expected c1 to be provided by 2 peers, is by %d", len(c1Provs)) + } +}
Test if datastore is checked upon cache miss on adding providers License: MIT
libp2p_go-libp2p-kad-dht
train
go
25ffe7f74a9379c165e905cf1f33db38d64949ea
diff --git a/lib/rack/app/singleton_methods/route_handling.rb b/lib/rack/app/singleton_methods/route_handling.rb index <HASH>..<HASH> 100644 --- a/lib/rack/app/singleton_methods/route_handling.rb +++ b/lib/rack/app/singleton_methods/route_handling.rb @@ -57,8 +57,8 @@ module Rack::App::SingletonMethods::RouteHandling @namespaces ||= [] @namespaces.push(request_path_namespace) yield + ensure @namespaces.pop - nil end end
refactor: move namespace pop part to ensure block
rack-app_rack-app
train
rb
c715361499f813322037e65d576c3d8553c09b25
diff --git a/lib/thinking_sphinx.rb b/lib/thinking_sphinx.rb index <HASH>..<HASH> 100644 --- a/lib/thinking_sphinx.rb +++ b/lib/thinking_sphinx.rb @@ -1,6 +1,7 @@ if RUBY_PLATFORM == 'java' require 'java' require 'jdbc/mysql' + Jdbc::MySQL.load_driver else require 'mysql2' end
Make sure MySQL driver is loaded for JDBC.
pat_thinking-sphinx
train
rb
cc82c732a54dca3ab77f25ed523537bccf923826
diff --git a/lib/foreman_discovery/engine.rb b/lib/foreman_discovery/engine.rb index <HASH>..<HASH> 100644 --- a/lib/foreman_discovery/engine.rb +++ b/lib/foreman_discovery/engine.rb @@ -173,10 +173,6 @@ module ForemanDiscovery # add dashboard widget widget 'discovery_widget', :name=>N_('Discovered Hosts'), :sizex => 6, :sizey =>1 - # allowed helpers and variables - allowed_template_helpers :rand - allowed_template_variables :kexec_kernel, :kexec_initrd - template_labels 'kexec' => N_('Discovery Kexec template') # apipie API documentation
Fixes #<I> - Removing macros that are in core Removing allowance of macros and variables because they are now live in core.
theforeman_foreman_discovery
train
rb
9877bf47e3cd11070bac6377ea734ca20ff364ba
diff --git a/testing/python/setup_plan.py b/testing/python/setup_plan.py index <HASH>..<HASH> 100644 --- a/testing/python/setup_plan.py +++ b/testing/python/setup_plan.py @@ -1,4 +1,5 @@ def test_show_fixtures_and_test(testdir): + """ Verifies that fixtures are not executed. """ p = testdir.makepyfile(''' import pytest @pytest.fixture
Improve commenting for setupplan unittest.
vmalloc_dessert
train
py
2b0b0b14e5f5c45384507f54197a05e50ded6a25
diff --git a/js/Axis.js b/js/Axis.js index <HASH>..<HASH> 100644 --- a/js/Axis.js +++ b/js/Axis.js @@ -53,6 +53,10 @@ Axis.prototype = { this._calculateTicks(); } } + + // Ticks to strings + _.each(this.ticks, function (tick) { tick.label += ''; }); + _.each(this.minorTicks, function (tick) { tick.label += ''; }); }, /**
Cast ticks to strings. Ensure ticks are strings before proceding. Tick formatters may return a number. We should not blow up because of this. Fixes #<I>.
HumbleSoftware_Flotr2
train
js
3c19b7afdcfeea726156c57e915aad70c6d619de
diff --git a/gwpy/table/tests/test_gravityspy.py b/gwpy/table/tests/test_gravityspy.py index <HASH>..<HASH> 100644 --- a/gwpy/table/tests/test_gravityspy.py +++ b/gwpy/table/tests/test_gravityspy.py @@ -35,12 +35,12 @@ JSON_RESPONSE = { "url4": [u"https://panoptes-uploads.zooniverse.org/production/" "subject_location/08895951-ea30-4cf7-9374-135a335afe0e.png"], "peak_frequency": [84.4759674072266], - "links_subjects": [5740011], + "links_subjects": [5740011.0], "ml_label": [u"Scratchy"], "searchedID": [u"8FHTgA8MEu"], "snr": [8.96664047241211], "gravityspy_id": [u"8FHTgA8MEu"], - "searchedzooID": [5740011], + "searchedzooID": [5740011.0], "ifo": [u"H1"], "url3": [u"https://panoptes-uploads.zooniverse.org/production/" "subject_location/415dde44-3109-434c-b3ad-b722a879c159.png"],
Ah yes the great int does not equal float dtype fail.
gwpy_gwpy
train
py
3879bba881f41b8c61b2202a95ef8ee8aed6a678
diff --git a/scout/server/blueprints/cases/controllers.py b/scout/server/blueprints/cases/controllers.py index <HASH>..<HASH> 100644 --- a/scout/server/blueprints/cases/controllers.py +++ b/scout/server/blueprints/cases/controllers.py @@ -59,8 +59,8 @@ def case(store, institute_obj, case_obj): case_obj['panel_names'] = [] for panel_info in case_obj.get('panels', []): if panel_info.get('is_default'): - panel_obj = store.panel(panel_info['panel_id']) - distinct_genes.update([gene['hgnc_id'] for gene in panel_obj['genes']]) + panel_obj = store.gene_panel(panel_info['panel_name'], version=panel_info.get('version')) + distinct_genes.update([gene['hgnc_id'] for gene in panel_obj.get('genes', [])]) full_name = "{} ({})".format(panel_obj['display_name'], panel_obj['version']) case_obj['panel_names'].append(full_name) case_obj['default_genes'] = list(distinct_genes)
Fetch correct gene panels in controller for cases
Clinical-Genomics_scout
train
py
efbba0682397323c3cc120b513f97d4f7d15108c
diff --git a/cartoframes/context.py b/cartoframes/context.py index <HASH>..<HASH> 100644 --- a/cartoframes/context.py +++ b/cartoframes/context.py @@ -335,13 +335,13 @@ class CartoContext(object): the length of the DataFrame. """ # noqa tqdm.write('Params: encode_geom, geom_col and everything in kwargs are deprecated and not being used any more') - dataset = Dataset.from_dataframe(df, table_name=table_name, context=self) + dataset = Dataset.from_dataframe(df) if_exists = Dataset.FAIL if overwrite: if_exists = Dataset.REPLACE - dataset = dataset.upload(with_lonlat=lnglat, if_exists=if_exists) + dataset = dataset.upload(with_lonlat=lnglat, if_exists=if_exists, table_name=table_name, context=self) tqdm.write('Table successfully written to CARTO: {table_url}'.format( table_url=utils.join_url(self.creds.base_url(), @@ -1577,8 +1577,7 @@ class CartoContext(object): if persist_as: dataset = Dataset.from_query(query, context=self) - dataset.table_name = persist_as - dataset.upload() + dataset.upload(table_name=persist_as) result = dataset.download(decode_geom=True) else: result = self.fetch(query, decode_geom=True)
using upload method with new params
CartoDB_cartoframes
train
py
ff4318066d8e3c4c6959081c04b9a9bfc88d2d39
diff --git a/huobitrade/service.py b/huobitrade/service.py index <HASH>..<HASH> 100644 --- a/huobitrade/service.py +++ b/huobitrade/service.py @@ -730,7 +730,7 @@ class HBRestAPI(metaclass=Singleton): class HBDerivativesRestAPI(metaclass=Singleton): - def __init__(self, url=None, keys=None, get_acc=False): + def __init__(self, url=None, keys=None): """ 火币合约REST API封装 :param url: 传入url,若为None,默认是https://api.hbdm.com @@ -740,17 +740,7 @@ class HBDerivativesRestAPI(metaclass=Singleton): if keys: setKey(*keys) - if get_acc: - try: - accounts = self.get_accounts()['data'] - self.acc_id = self.get_accounts()['data'][0]['id'] - if len(accounts) > 1: - warnings.warn(f'默认设置acc_id为{self.acc_id}') - except Exception as e: - raise Exception(f'Failed to get account: key may not be set ->{e}') - def set_acc_id(self, acc_id): - self.acc_id = acc_id def __async_request_exception_handler(self, req, e): logger.error(f'async_request:{req}--exception:{e}')
debug, derivatives trading did not need acc_id
hadrianl_huobi
train
py
f105b5316b0633c256174d42c30788ffb361c39d
diff --git a/library/oxAcceptanceTestCase.php b/library/oxAcceptanceTestCase.php index <HASH>..<HASH> 100644 --- a/library/oxAcceptanceTestCase.php +++ b/library/oxAcceptanceTestCase.php @@ -1764,7 +1764,8 @@ class oxAcceptanceTestCase extends oxMinkWrapper public function clearCookies() { $testConfig = new oxTestConfig(); - $this->open($testConfig->getShopUrl() . '/_cc.php?' . time()); + $shopUrl = preg_replace("|(https?://[^:/]*?):[0-9]+|", '$1', $testConfig->getShopUrl()); + $this->open($shopUrl . '/_cc.php'); if ($this->getHtmlSource() != '<head></head><body></body>') { $this->getMinkSession()->stop(); }
Fix clearing cookies when varnish is enabled _cc is unable to clear browser cookies when called via varnish url (url with port), therefore port is removed before calling this file.
OXID-eSales_testing_library
train
php
8bea562ea22390d2d171c4d3fefb4e414767862f
diff --git a/lib/zendesk2/version.rb b/lib/zendesk2/version.rb index <HASH>..<HASH> 100644 --- a/lib/zendesk2/version.rb +++ b/lib/zendesk2/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true module Zendesk2 - VERSION = '1.12.0'.freeze + VERSION = '1.13.0'.freeze end
Bump zendesk2 to <I>
lanej_zendesk2
train
rb
9e9c75636cb02c2d76c15abd077854b0ebfab1ab
diff --git a/internetarchive/iacli/ia_delete.py b/internetarchive/iacli/ia_delete.py index <HASH>..<HASH> 100755 --- a/internetarchive/iacli/ia_delete.py +++ b/internetarchive/iacli/ia_delete.py @@ -56,6 +56,10 @@ def main(argv): files = [f for f in [item.get_file(f) for f in fnames] if f] + if not files: + sys.stderr.write(' warning: no files found, nothing deleted.\n') + sys.exit(1) + for f in files: if not f: if verbose:
better error message if no file is found to delete.
jjjake_internetarchive
train
py
13c98ad1ccef834a03c9b06f13329e0cd0bda8f4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name='py-august', - version='0.2.0', + version='0.3.0', packages=['august'], url='https://github.com/snjoetw/py-august', license='MIT',
- Bumped version to <I>
snjoetw_py-august
train
py
407e8f2a46d835677e82f9b1b99232f50e65b7f5
diff --git a/keyring/backends/fail.py b/keyring/backends/fail.py index <HASH>..<HASH> 100644 --- a/keyring/backends/fail.py +++ b/keyring/backends/fail.py @@ -9,12 +9,12 @@ class Keyring(KeyringBackend): >>> kr.get_password('svc', 'user') Traceback (most recent call last): ... - RuntimeError: ... + RuntimeError: ...No recommended backend... """ priority = 0 def get_password(self, service, username, password=None): - raise RuntimeError("No recommended password was available") + raise RuntimeError("No recommended backend was available") set_password = delete_pasword = get_password
Correct error message to better communicate what is missing. Ref #<I>.
jaraco_keyring
train
py
e2965c2d30502d0f7eb4d7cdcb21d63a55af8727
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '3.2.5'; - const VERSION_ID = 30205; + const VERSION = '3.2.6-DEV'; + const VERSION_ID = 30206; const MAJOR_VERSION = 3; const MINOR_VERSION = 2; - const RELEASE_VERSION = 5; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 6; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '07/2017'; const END_OF_LIFE = '01/2018';
bumped Symfony version to <I>
symfony_symfony
train
php
eb8781b3ff21d7fb93bea5e3efe83f9ab151c7c2
diff --git a/spec/visitors/chewy_term_filter/visit_value_spec.rb b/spec/visitors/chewy_term_filter/visit_value_spec.rb index <HASH>..<HASH> 100644 --- a/spec/visitors/chewy_term_filter/visit_value_spec.rb +++ b/spec/visitors/chewy_term_filter/visit_value_spec.rb @@ -2,15 +2,15 @@ require 'spec_helper' describe MSFL::Visitors::ChewyTermFilter do - let(:collector) { Array.new } + subject { node.accept visitor } let(:node) { fail ArgumentError, "You must define the node variable in each scope." } - let(:test_instance) { described_class.new } + let(:visitor) { described_class.new collector } - describe "#visit_MSFL_Nodes_Boolean" do + let(:collector) { Array.new } - subject { test_instance.visit_MSFL_Nodes_Boolean node, collector } + describe "visiting a Boolean node" do let(:node) { MSFL::Nodes::Boolean.new value } @@ -33,9 +33,7 @@ describe MSFL::Visitors::ChewyTermFilter do end end - describe "#visit_MSFL_Nodes_Word" do - - subject { test_instance.visit_MSFL_Nodes_Word node, collector } + describe "visiting a Word node" do let(:node) { MSFL::Nodes::Word.new "node_content" }
Updated visit_value_spec to conform with new visit_ testing convention
Referly_msfl_visitors
train
rb
dbb431049759cef1afb97c266f3314be5cbec279
diff --git a/test/spec/selectBoxItSpec.js b/test/spec/selectBoxItSpec.js index <HASH>..<HASH> 100644 --- a/test/spec/selectBoxItSpec.js +++ b/test/spec/selectBoxItSpec.js @@ -25,7 +25,7 @@ describe('selectBoxIt jQuery Plugin', function () { expect(selectBoxIt.div).toExist(); - expect(selectBoxIt.div).toBe("div"); + expect(selectBoxIt.div).toBe("span"); expect(selectBoxIt.div).toBeVisible();
Updated SelectBoxIt tests suite to look for a span instead of a div
gfranko_jquery.selectBoxIt.js
train
js
e51071abf43e8e25a0e0426988b7e0f4f46e1d24
diff --git a/src/backends/backend.js b/src/backends/backend.js index <HASH>..<HASH> 100644 --- a/src/backends/backend.js +++ b/src/backends/backend.js @@ -30,7 +30,7 @@ const slugFormatter = (template = "{{slug}}", entryData) => { const getIdentifier = (entryData) => { const validIdentifierFields = ["title", "path"]; const identifiers = validIdentifierFields.map((field) => - entryData.find((_, key) => key.toLowerCase() === field) + entryData.find((_, key) => key.toLowerCase().trim() === field) ); const identifier = identifiers.find(ident => ident !== undefined);
Change .find() predicate to not reject field names based on spurious whitespace.
netlify_netlify-cms
train
js
d7cfd9b2f1fcd0fb08cde042d79c3c9022dbba4d
diff --git a/drivers/bridge/bridge.go b/drivers/bridge/bridge.go index <HASH>..<HASH> 100644 --- a/drivers/bridge/bridge.go +++ b/drivers/bridge/bridge.go @@ -926,6 +926,11 @@ func (d *driver) CreateEndpoint(nid, eid types.UUID, epInfo driverapi.EndpointIn } endpoint.macAddress = mac + // Up the host interface after finishing all netlink configuration + if err := netlink.LinkSetUp(host); err != nil { + return fmt.Errorf("could not set link up for host interface %s: %v", hostIfName, err) + } + // v6 address for the sandbox side pipe interface ipv6Addr = &net.IPNet{} if config.EnableIPv6 {
Manually bring up the host side veth interface In preparation for the new update of vishvananda/netlink package we need to bringup the host veth interface manually.
docker_libnetwork
train
go
53a3e716015d8add3959aa00e70fb43ff24b18e2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( packages=['spreadsheetresponsemixin'], include_package_data=True, license=LICENSE, - description='An mixin for views with a queryset that provides a CSV/Excel export.', + description='A mixin for views with a queryset that provides a CSV/Excel export.', long_description=README, url='https://github.com/birdsarah/django-spreadsheetresponsemixin', author='Sarah Bird',
setup.py description grammar fix Changing "An mixin" to "A mixin"
birdsarah_django-spreadsheetresponsemixin
train
py
9a21712262acf6665b7c0b8d8d8a9899d840572e
diff --git a/tutorials/xhrPagingDemo.js b/tutorials/xhrPagingDemo.js index <HASH>..<HASH> 100644 --- a/tutorials/xhrPagingDemo.js +++ b/tutorials/xhrPagingDemo.js @@ -72,7 +72,7 @@ function demo() { callback(data, offset, rows); }); // rows is not used by this API, other APIs usually define some sort of records per page - url = 'http://jservice.io/api/clues?offset=:offset' + url = 'https://jservice.io/api/clues?offset=:offset' .replace(':offset', offset) .replace(':rows', rows); xhr.open('GET', url);
changed to https, but it probably wont help
TonyGermaneri_canvas-datagrid
train
js
bf024b6a11253b3d2599caf41f7ccf2d31e68cb3
diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index <HASH>..<HASH> 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -12,7 +12,7 @@ Rails::Initializer.run do |config| # -- all .rb files in that directory are automatically loaded. # Add additional load paths for your own custom dirs - # config.load_paths += %w( #{RAILS_ROOT}/extras ) + # config.load_paths += %W( #{RAILS_ROOT}/extras ) # Specify gems that this application depends on and have them installed with rake gems:install # config.gem "bj" @@ -36,6 +36,6 @@ Rails::Initializer.run do |config| config.time_zone = 'UTC' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path << Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] # config.i18n.default_locale = :de end \ No newline at end of file
Github comments are an excellent way to perform community code review -- keep it up!
rails_rails
train
rb
267995827fdee99d63372f1221a3adf64f29e52a
diff --git a/src/Robo/Commands/Tests/BehatCommand.php b/src/Robo/Commands/Tests/BehatCommand.php index <HASH>..<HASH> 100644 --- a/src/Robo/Commands/Tests/BehatCommand.php +++ b/src/Robo/Commands/Tests/BehatCommand.php @@ -127,6 +127,8 @@ class BehatCommand extends TestsCommandBase { ->option("webdriver", 4444) ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE) ->background() + ->timeout(6000) + ->silent(true) ->run(); }
Increasing timeout for PhantomJS.
acquia_blt
train
php
d2b38aa5cd6d739fd48bf5149f3a785672fc661b
diff --git a/packages/@ember/application/lib/application.js b/packages/@ember/application/lib/application.js index <HASH>..<HASH> 100644 --- a/packages/@ember/application/lib/application.js +++ b/packages/@ember/application/lib/application.js @@ -45,7 +45,7 @@ let librariesRegistered = false; `Application` class, which will be run by Ember when the application is initialized. - ```javascript + ```app/app.js const App = Application.extend({ ready() { // your code here
Update packages/@ember/application/lib/application.js
emberjs_ember.js
train
js
71960403ceeb0b1562e92c1123d2031c3a885db1
diff --git a/src/codemod.py b/src/codemod.py index <HASH>..<HASH> 100755 --- a/src/codemod.py +++ b/src/codemod.py @@ -780,7 +780,7 @@ def _parse_command_line(): parser.add_argument('-m', action='store_true', help='Have regex work over multiple lines (e.g. have dot match newlines). ' 'By default, codemod applies the regex one line at a time.') - parser.add_argument('-d', action='store', type=str, + parser.add_argument('-d', action='store', type=str, default='.', help='The path whose descendent files are to be explored. ' 'Defaults to current dir.')
Fix default param for directory Without this, running without -d simply fails with an error since the directory is None instead of .
facebook_codemod
train
py
652125367c9a98b08ff02da9008db66f39be9741
diff --git a/receive_stream.go b/receive_stream.go index <HASH>..<HASH> 100644 --- a/receive_stream.go +++ b/receive_stream.go @@ -29,7 +29,6 @@ type receiveStream struct { sender streamSender frameQueue *frameSorter - readOffset protocol.ByteCount finalOffset protocol.ByteCount currentFrame []byte @@ -169,7 +168,6 @@ func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, err m := copy(p[bytesRead:], s.currentFrame[s.readPosInFrame:]) s.readPosInFrame += m bytesRead += m - s.readOffset += protocol.ByteCount(m) s.mutex.Lock() // when a RESET_STREAM was received, the was already informed about the final byteOffset for this stream
remove unused readOffset member variable in receiveStream
lucas-clemente_quic-go
train
go
b314d684767b1f400111b60672d6b55ef278feb4
diff --git a/mollie/api/objects/order.py b/mollie/api/objects/order.py index <HASH>..<HASH> 100644 --- a/mollie/api/objects/order.py +++ b/mollie/api/objects/order.py @@ -146,7 +146,7 @@ class Order(Base): refund = OrderRefunds(self.client).on(self).create(data, **params) return refund - def cancel_lines(self, data=None, **params): + def cancel_lines(self, data=None): """Cancel the lines given. When no lines are given, cancel all the lines. Canceling an order line causes the order line status to change to canceled. @@ -154,7 +154,7 @@ class Order(Base): """ from ..resources.order_lines import OrderLines - canceled = OrderLines(self.client).on(self).delete(data, **params) + canceled = OrderLines(self.client).on(self).delete(data) return canceled @property
**params are not useful nor supported when sending a DELETE
mollie_mollie-api-python
train
py
e8e20de4ad69c6393fa758fd6bce6493c6bfcbf6
diff --git a/lexicon/providers/auto.py b/lexicon/providers/auto.py index <HASH>..<HASH> 100644 --- a/lexicon/providers/auto.py +++ b/lexicon/providers/auto.py @@ -44,13 +44,13 @@ def _get_ns_records_for_domain(domain): # Available both for Windows and Linux (if dnsutils is installed for the latter) try: output = subprocess.check_output(['nslookup', '-querytype=NS', domain], - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, universal_newlines=True) except subprocess.CalledProcessError as e: if 'NXDOMAIN' in e.output: raise ValueError('Error, domain {0} could not be resolved.'.format(domain)) pattern = re.compile(r'nameserver = (.*?)\.*{0}'.format(os.linesep)) - match = pattern.findall(output.decode()) + match = pattern.findall(output) if not match: raise ValueError('Error, could not find ns entries for domain {0}. '
Protect nslookup call against non-ANSI and non-UTF8 output
AnalogJ_lexicon
train
py
e818bd0fd1d920df9b4404f49f7d236e25d65e4f
diff --git a/eth/vm/code_stream.py b/eth/vm/code_stream.py index <HASH>..<HASH> 100644 --- a/eth/vm/code_stream.py +++ b/eth/vm/code_stream.py @@ -39,12 +39,18 @@ class CodeStream(object): def __len__(self) -> int: return self._length_cache - def __iter__(self) -> 'CodeStream': - return self - def __getitem__(self, i: int) -> int: return self._raw_code_bytes[i] + def __iter__(self) -> Iterator[int]: + # a very performance-sensitive method + read = self.read + try: + while True: + yield ord(read(1)) + except TypeError: + yield STOP + def __next__(self) -> int: # a very performance-sensitive method next_opcode_as_byte = self._bound_stream_read(1)
CodeStream.__iter__ speedup (<I>%) Avoid a self.read references, byte check, and call overhead to __next__() at every iteration (assuming that re-starting the generator is faster than invoking __next__() again). Pretty surprising that this didn't give more speedup actually. It's essentially undetectable.
ethereum_py-evm
train
py
26497db3541c062c84dd0d9a0b4449ea04470043
diff --git a/core/array.rb b/core/array.rb index <HASH>..<HASH> 100644 --- a/core/array.rb +++ b/core/array.rb @@ -978,7 +978,7 @@ class Array } end - def zip(*others) + def zip(*others, &block) %x{ var result = [], size = this.length, part, o; @@ -998,6 +998,14 @@ class Array result[i] = part; } + if (block !== nil) { + for (var i = 0; i < size; i++) { + block.call($context, result[i]); + } + + return nil; + } + return result; } end diff --git a/core_spec/core/array/zip_spec.rb b/core_spec/core/array/zip_spec.rb index <HASH>..<HASH> 100644 --- a/core_spec/core/array/zip_spec.rb +++ b/core_spec/core/array/zip_spec.rb @@ -11,4 +11,13 @@ describe "Array#zip" do [1, 2, 3, 4, 5].zip(["a", "b", "c", "d"]).should == [[1, "a"], [2, "b"], [3, "c"], [4, "d"], [5, nil]] end + + it "calls block if supplied" do + values = [] + [1, 2, 3, 4].zip(["a", "b", "c", "d", "e"]) { |value| + values << value + }.should == nil + + values.should == [[1, "a"], [2, "b"], [3, "c"], [4, "d"]] + end end
Add block support to Array#zip
opal_opal
train
rb,rb
7ec74631ebf84ba19f13b172ca5df46ce457d78a
diff --git a/lib/wechat/http_client.rb b/lib/wechat/http_client.rb index <HASH>..<HASH> 100644 --- a/lib/wechat/http_client.rb +++ b/lib/wechat/http_client.rb @@ -8,7 +8,7 @@ module Wechat @base = base @httprb = HTTP.timeout(:global, write: timeout, connect: timeout, read: timeout) @ssl_context = OpenSSL::SSL::SSLContext.new - @ssl_context.ssl_version = :TLSv1_client + @ssl_context.ssl_version = :TLSv1 @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE if skip_verify_ssl end
Fix TLSv1_client method type "_client" is ignored in Ruby <I>
Eric-Guo_wechat
train
rb
dfb4c1d3e9a3170543d39d255658abf4483a6bd7
diff --git a/emailtemplates/email.py b/emailtemplates/email.py index <HASH>..<HASH> 100644 --- a/emailtemplates/email.py +++ b/emailtemplates/email.py @@ -6,7 +6,7 @@ from smtplib import SMTPException from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.mail import EmailMessage -from django.template import Template, Context, TemplateDoesNotExist +from django.template import Template, TemplateDoesNotExist from django.template.loader import get_template from .models import now, EmailTemplate @@ -110,8 +110,7 @@ class EmailFromTemplate(object): def render_message(self): self.__compile_template() - context = Context(self.context) - self.message = self.compiled_template.render(context) + self.message = self.compiled_template.render(self.context) def send_email(self, send_to, *args, **kwargs): """
Removed Context from render_to_response function - support for django <I>
deployed_django-emailtemplates
train
py
d814bf229771c5d4cf0cf27486a84aeb89e265d0
diff --git a/tests/test_module_doc.py b/tests/test_module_doc.py index <HASH>..<HASH> 100644 --- a/tests/test_module_doc.py +++ b/tests/test_module_doc.py @@ -47,11 +47,7 @@ OBSELETE_PARAM = [ RE_PARAM = re.compile( '^ - `(?P<name>[^`]*)`.*?(' '\*\(default (?P<value>(' - '("[^"]*")' # double quote strings - '|' - "('[^']*')" # quote strings - '|' - '([^)]*)' # anything else + '.*' '))\)\*)?$' ) @@ -164,6 +160,8 @@ def get_module_attributes(path): # NameConstant so we use them for the default default = python2_names.get(value.id) attr_value = extra.get(value.id, default) + elif class_name == 'Tuple': + attr_value = tuple(map(get_value, value.elts)) elif class_name == 'UnaryOp': op = value.op.__class__.__name__ attr_value = get_value(value.operand)
Add tuples support to doc checker
ultrabug_py3status
train
py
b081342b44672a149fbf727c3ec0d47885e2d683
diff --git a/tests/compute/helper.rb b/tests/compute/helper.rb index <HASH>..<HASH> 100644 --- a/tests/compute/helper.rb +++ b/tests/compute/helper.rb @@ -26,12 +26,12 @@ def compute_providers }, :server_attributes => {}.tap do |hash| [:zone_id, :network_ids, :image_id, :flavor_id].each do |k| - hash[k]= Fog.credentials[:cloudstack][k] + hash[k]= Fog.credentials[:cloudstack] && Fog.credentials[:cloudstack][k] end end, :volume_attributes => {:name => "somevolume"}.tap do |hash| [:zone_id, :disk_offering_id].each do |k| - hash[k]= Fog.credentials[:cloudstack][k] + hash[k]= Fog.credentials[:cloudstack] && Fog.credentials[:cloudstack][k] end end, :mocked => true
[cloudstack] prevent mock test failure when cloudstack credentials are not defined
fog_fog
train
rb
61b33c7ec9ba883fff8b49510d673644adf52ac5
diff --git a/src/config/form.php b/src/config/form.php index <HASH>..<HASH> 100644 --- a/src/config/form.php +++ b/src/config/form.php @@ -46,7 +46,7 @@ return array( */ 'fieldset' => array( - 'button' => array('class' => 'btn'), + 'button' => array(), 'checkbox' => array(), 'file' => array(), 'input' => array('class' => 'twelve columns input-with-feedback'), @@ -60,7 +60,7 @@ return array( 'button' => function ($data) { return Form::button( $data->value, - $data->attributes + HTML::decorate($data->attributes, array('class' => 'btn')) ); }, 'checkbox' => function ($data) {
Slightly reorganize the config.
orchestral_html
train
php
adff1b5ad7bf30fbd15cf1b9f06cdbf2dfd22a0b
diff --git a/lib/para/inputs/nested_one_input.rb b/lib/para/inputs/nested_one_input.rb index <HASH>..<HASH> 100644 --- a/lib/para/inputs/nested_one_input.rb +++ b/lib/para/inputs/nested_one_input.rb @@ -12,6 +12,8 @@ module Para unless (resource = object.send(:"#{ attribute_name }")) # Build association without trying to save the new record resource = case association + when ActiveRecord::Associations::HasOneThroughAssociation + association.replace(model.new) when ActiveRecord::Associations::HasOneAssociation association.replace(model.new, false) else
fix issue with HasOneThroughAssociation nested fields building
para-cms_para
train
rb
d6513a304ff60dc7ff4e93fb53a620bdde88f384
diff --git a/core/src/main/java/org/bitcoinj/wallet/Wallet.java b/core/src/main/java/org/bitcoinj/wallet/Wallet.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/wallet/Wallet.java +++ b/core/src/main/java/org/bitcoinj/wallet/Wallet.java @@ -1128,6 +1128,12 @@ public class Wallet extends BaseTaggableObject } } + /** @deprecated Use {@link #findKeyFromPubKeyHash(byte[], ScriptType)} */ + @Deprecated + public ECKey findKeyFromPubHash(byte[] pubKeyHash) { + return findKeyFromPubKeyHash(pubKeyHash, Script.ScriptType.P2PK); + } + /** * Locates a keypair from the basicKeyChain given the hash of the public key. This is needed when finding out which * key we need to use to redeem a transaction output.
Wallet: Add back deprecated findKeyFromPubHash() for compatibility.
bitcoinj_bitcoinj
train
java
63f3f6042e6fc6fb526ed45e3c2a33f8cad9d488
diff --git a/lib/CustomPredefs.js b/lib/CustomPredefs.js index <HASH>..<HASH> 100644 --- a/lib/CustomPredefs.js +++ b/lib/CustomPredefs.js @@ -16,6 +16,11 @@ define ( function(){ angular: [ 'angular' ], + 'angular-scenario': { + deps: [ 'angular' ], + dict: [ 'pause', 'sleep', 'browser', 'expect', 'using', 'binding', 'input', 'repeater', 'select', 'element' ] + }, + backbone: { deps: [ 'jquery', 'underscore'], dict: [ 'Backbone' ]
Added functions from Angular JS E2E testing.
fivetanley_warn.js
train
js
bedf2bc1619336a80fc320527a70f63187343072
diff --git a/atlassian/jira.py b/atlassian/jira.py index <HASH>..<HASH> 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -90,6 +90,19 @@ class Jira(AtlassianRestAPI): limit=limit) return self.get(url) + def get_all_users_from_group(self, group, include_inactive_users=False, start=0, limit=50): + """ + Just wrapping method user group members + :param group: + :param include_inactive_users: + :param start: + :param limit: + :return: + """ + url = "rest/api/2/group/member?groupname={group}&includeInactiveUsers={include_inactive}&startAt={start}&maxResults={limit}".format( + group=group, include_inactive=include_inactive_users, start=start, limit=limit) + return self.get(url) + def issue_exists(self, issuekey): try: self.issue(issuekey, fields='*none')
Add method for the get user group members
atlassian-api_atlassian-python-api
train
py
d3c6f41b49e6f9ccd1536f78e9e1669276e65125
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -19,8 +19,8 @@ function _build(jobName, params, args) { console.log(message, jobName); // wait for pending period setTimeout(function () { - _console()(jobName); - }, 5000); + _console(jobName); + }, args.pending || 5000); } }; } else { @@ -36,7 +36,7 @@ function _console(jobName) { jenkins.console(jobName, bag.cli.exit); } -function _stop(jobName, params) { +function _stop(jobName) { jenkins.stop( jobName, bag.cli.exitCb(null, function (result) {
Add pending arg to override default 5 secs timeout before calling console after build.
cliffano_nestor
train
js
adc78a3c7dc913caeaa26fc3331923a88a6aa276
diff --git a/Kernel.php b/Kernel.php index <HASH>..<HASH> 100644 --- a/Kernel.php +++ b/Kernel.php @@ -61,6 +61,10 @@ class Kernel extends Component foreach ($this->config->get('factories', []) as $interface => $definitions) { foreach ($definitions as $name => $definition) { + if (is_string($definition) && $definition[0] === '#') { + $definition = "@$interface$definition"; + } + $this->container->set("$interface#$name", $definition); if ($name === 'default') {
ManaPHP\Kernel supporting factory of # reference
manaphp_framework
train
php
46426c03ce632b766b07f49e48bf411cd337e590
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ with open('README.rst', 'r') as f: setup( name='pyttsx3', packages=['pyttsx3', 'pyttsx3.drivers'], - version='2.8', + version='2.86', description='Text to Speech (TTS) library for Python 2 and 3. Works without internet connection or delay. Supports multiple TTS engines, including Sapi5, nsss, and espeak.', long_description=long_description, summary='Offline Text to Speech library with multi-engine support',
updated version <I> after reverting to commit 3b<I>e4 to fix
nateshmbhat_pyttsx3
train
py
88f2d58328bc7b6c4baa2b573bac48e0b5b6165a
diff --git a/project/library/CM/Mail.php b/project/library/CM/Mail.php index <HASH>..<HASH> 100644 --- a/project/library/CM/Mail.php +++ b/project/library/CM/Mail.php @@ -183,7 +183,7 @@ class CM_Mail extends CM_Renderable_Abstract { } list($subject, $html, $text) = CM_Render::getInstance($site)->render($this); if ($this->_delayed) { - $this->_queue($text, $html); + $this->_queue($subject, $text, $html); } else { self::_send($subject, $text, $this->_senderAddress, $this->_recipientAddress, $this->_senderName, $html); } @@ -208,8 +208,8 @@ class CM_Mail extends CM_Renderable_Abstract { } } - private function _queue($text, $html) { - CM_Mysql::insert(TBL_CM_MAIL, array('subject' => $this->_subject, 'text' => $text, 'html' => $html, + private function _queue($subject, $text, $html) { + CM_Mysql::insert(TBL_CM_MAIL, array('subject' => $subject, 'text' => $text, 'html' => $html, 'senderAddress' => $this->_senderAddress, 'recipientAddress' => $this->_recipientAddress, 'senderName' => $this->_senderName, 'createStamp' => time())); }
mail-queue has no subject; fixed
cargomedia_cm
train
php
60add58ecaa2aaad519558a53eeb5fb45ac9f7b2
diff --git a/src/define/build.js b/src/define/build.js index <HASH>..<HASH> 100644 --- a/src/define/build.js +++ b/src/define/build.js @@ -28,11 +28,20 @@ var _gpfDefinedEntities = []; * @since 0.2.4 */ function _gpfDefineGetEntityFromBuilder (instanceBuilder) { - return _gpfArrayForEachFalsy(_gpfDefinedEntities, function (entityDefinition) { + var result = _gpfArrayForEachFalsy(_gpfDefinedEntities, function (entityDefinition) { if (entityDefinition.getInstanceBuilder() === instanceBuilder) { return entityDefinition; } }); + if (!result) { + // Reversed lookup because the level + result = _gpfArrayForEachFalsy([].concat(_gpfDefinedEntities).reverse(), function (entityDefinition) { + if (instanceBuilder.prototype instanceof entityDefinition.getInstanceBuilder()) { + return entityDefinition; + } + }); + } + return result; } Object.assign(_GpfEntityDefinition.prototype, {
Working on native inheritance (#<I>)
ArnaudBuchholz_gpf-js
train
js
a975a055e9d4f90be98d9362a1196016d5b581d9
diff --git a/src/gc.js b/src/gc.js index <HASH>..<HASH> 100644 --- a/src/gc.js +++ b/src/gc.js @@ -59,6 +59,7 @@ function GarbageCollector(consumer) { } function registerEvents() { + unregisterEvents(); consumer.on(events.GC_SM_QUEUE, (queue) => { debug(`Inspecting processing queue [${queue}]... `); const { queueName, consumerId } = redisKeys.getKeySegments(queue); @@ -209,7 +210,6 @@ function GarbageCollector(consumer) { redisClientInstance = null; messageCollector = null; ticker = null; - unregisterEvents(); powerStateManager.down(); consumer.emit(events.GC_DOWN); });
Always call unregisterEvents() before registering new events In case of improper shutdown, this will prevent GC from behaving incorrectly (duplicate listeners) and also from memory leakage (accumulating listeners).
weyoss_redis-smq
train
js
d54494892b6c3fff872076177ea432f2cef1772b
diff --git a/zetta-app.js b/zetta-app.js index <HASH>..<HASH> 100644 --- a/zetta-app.js +++ b/zetta-app.js @@ -173,8 +173,18 @@ function Application(appFolder, appConfig) { if(self.config.caption) zutils.render(self.config.caption); - if(self.config.translator) - self.translator = new Translator({ storagePath : path.join(appFolder,'config') }); + if(self.config.translator) { + var options = { + storagePath: path.join(appFolder,'config'), + rootFolderPath: appFolder + }; + options = _.extend(self.config.translator, options); + + self.translator = new Translator(options, function() { + self.translator.separateEditor(); + }); + } + http.globalAgent.maxSockets = self.config.maxHttpSockets || 1024; // 1024; https.globalAgent.maxSockets = self.config.maxHttpSockets || 1024; @@ -485,16 +495,6 @@ function Application(appFolder, appConfig) { // }) - - if(self.config.translator) { - self.translator.init(self.config.translator, function () { - self.translator.separateEditor(); - finish(); - }); - - return; - } - finish(); function finish() {
Fixed some problems with new version of zetta-translator
aspectron_iris-app
train
js
d232e1197b81ac25cb9b4f5a552ad7e5b4b3084d
diff --git a/core/client/fs/src/main/java/alluxio/client/block/stream/NettyPacketWriter.java b/core/client/fs/src/main/java/alluxio/client/block/stream/NettyPacketWriter.java index <HASH>..<HASH> 100644 --- a/core/client/fs/src/main/java/alluxio/client/block/stream/NettyPacketWriter.java +++ b/core/client/fs/src/main/java/alluxio/client/block/stream/NettyPacketWriter.java @@ -106,7 +106,7 @@ public final class NettyPacketWriter implements PacketWriter { /** This condition is met if mPacketWriteException != null or the buffer is not full. */ private final Condition mBufferNotFullOrFailed = mLock.newCondition(); /** This condition is met if there is nothing in the netty buffer. */ - private Condition mBufferEmptyOrFailed = mLock.newCondition(); + private final Condition mBufferEmptyOrFailed = mLock.newCondition(); /** * @param context the file system context
Improve core/client/fs/src/main/java/alluxio/client/block/stream/NettyPacketWriter.java as mBufferNotFullOrFailed can be marked as final.\nChange\n private Condition mBufferNotFullOrFailed = mLock.newCondition();\nto\n private final Condition mBufferNotFullOrFailed = mLock.newCondition();
Alluxio_alluxio
train
java
aec0f4517cbfa38c6b4502a884a6db0f1a71fb0d
diff --git a/components/input/__tests__/textarea.test.js b/components/input/__tests__/textarea.test.js index <HASH>..<HASH> 100644 --- a/components/input/__tests__/textarea.test.js +++ b/components/input/__tests__/textarea.test.js @@ -115,6 +115,7 @@ describe('TextArea', () => { }, }, ]); + await Promise.resolve(); expect(onResize).toHaveBeenCalledWith( expect.objectContaining({ diff --git a/components/page-header/__tests__/index.test.js b/components/page-header/__tests__/index.test.js index <HASH>..<HASH> 100644 --- a/components/page-header/__tests__/index.test.js +++ b/components/page-header/__tests__/index.test.js @@ -112,9 +112,10 @@ describe('PageHeader', () => { expect(render(wrapper)).toMatchSnapshot(); }); - it('change container width', () => { + it('change container width', async () => { const wrapper = mount(<PageHeader title="Page Title" extra="extra" />); wrapper.triggerResize(); + await Promise.resolve(); wrapper.update(); expect(wrapper.find('.ant-page-header').hasClass('ant-page-header-compact')).toBe(true); });
test: Fix resize related test case
ant-design_ant-design
train
js,js
9dea68a4ef42dd90c6785c4d8ea629ae156b8e17
diff --git a/lib/active_admin_import/model.rb b/lib/active_admin_import/model.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin_import/model.rb +++ b/lib/active_admin_import/model.rb @@ -138,8 +138,10 @@ module ActiveAdminImport def encode(data) data = content_encode(data) if force_encoding? - data = data.encode('UTF-8', - invalid: :replace, undef: :replace) + data = data.encode( + 'UTF-8', + invalid: :replace, undef: :replace, universal_newline: true + ) begin data.sub("\xEF\xBB\xBF", '') # bom rescue StandardError => _
universal_newline - Replaces \rn and \r with \n
activeadmin-plugins_active_admin_import
train
rb
9ee60775897d17c8bf988825178222e85da50005
diff --git a/client-js/utilities/fetch-json.js b/client-js/utilities/fetch-json.js index <HASH>..<HASH> 100644 --- a/client-js/utilities/fetch-json.js +++ b/client-js/utilities/fetch-json.js @@ -18,7 +18,12 @@ export default function fetchJson(method, url, body) { opts.body = JSON.stringify(body) } - return fetch(BASE_URL + url, opts) + let fetchUrl = BASE_URL + url + if (BASE_URL && url.substring(0, 1) !== '/') { + fetchUrl = BASE_URL + '/' + url + } + + return fetch(fetchUrl, opts) .then(response => { // API server will send 200 even if error occurs // Eventually this should change to proper status code usage
Fix api/app GET when BASE_URL is defined (#<I>)
rickbergfalk_sqlpad
train
js
7617ea31833232cdf2cd39b55273514b8d859ef6
diff --git a/core/Tracker/TableLogAction.php b/core/Tracker/TableLogAction.php index <HASH>..<HASH> 100644 --- a/core/Tracker/TableLogAction.php +++ b/core/Tracker/TableLogAction.php @@ -233,6 +233,11 @@ class TableLogAction } /** + * This function will sanitize or not if it's needed for the specified action type + * + * URLs (Page URLs, Downloads, Outlinks) are stored raw (unsanitized) + * while other action types are stored Sanitized + * * @param $actionType * @param $actionString * @return string
add a comment about perceived inconsistencies
matomo-org_matomo
train
php
e5048fec649e040df3b98aabf45f4dd2bb3ced5d
diff --git a/cdn/controllers/blank_avatar.php b/cdn/controllers/blank_avatar.php index <HASH>..<HASH> 100644 --- a/cdn/controllers/blank_avatar.php +++ b/cdn/controllers/blank_avatar.php @@ -53,7 +53,7 @@ class NAILS_Blank_avatar extends NAILS_CDN_Controller // Determine dynamic values $this->_width = $this->uri->segment( 3, 100 ); $this->_height = $this->uri->segment( 4, 100 ); - $this->_sex = $this->uri->segment( 5, 'man' ); + $this->_sex = strtolower( $this->uri->segment( 5, 'man' ) ); // Set a unique filename (but one which is constant if requested twice, i.e // no random values)
Ignoring case of sex
nails_module-cdn
train
php
a61c1e31daa13ac6a9c37d1e3a09d5246ec849f3
diff --git a/lib/fluent/plugin/out_file.rb b/lib/fluent/plugin/out_file.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/out_file.rb +++ b/lib/fluent/plugin/out_file.rb @@ -223,7 +223,12 @@ module Fluent::Plugin def write_without_compression(path, chunk) File.open(path, "ab", @file_perm) do |f| - chunk.write_to(f) + if @append + content = chunk.read() + f.puts content + else + chunk.write_to(f) + end end end
Make out_file append option work without compression For Ruby <I>.x and <I>.x, out_file append option without compression does not work. The cause is the following Ruby language bug: <URL>
fluent_fluentd
train
rb
dba705d8e5f0c70bf920f7c1f2fb9b5c84b7db2c
diff --git a/src/Controller/RolesController.php b/src/Controller/RolesController.php index <HASH>..<HASH> 100644 --- a/src/Controller/RolesController.php +++ b/src/Controller/RolesController.php @@ -32,7 +32,7 @@ class RolesController extends AppController public function view($id = null) { $role = $this->Roles->get($id, [ - 'contain' => ['Groups'] + 'contain' => ['Groups', 'Capabilities'] ]); $this->set('role', $role); $this->set('_serialize', ['role']);
passing related capabilities to View (task #<I>)
QoboLtd_cakephp-roles-capabilities
train
php
169caee8bfff2d67142ef6db8dddc9f264f26a23
diff --git a/rapidoid-pages/src/main/java/org/rapidoid/widget/PagerWidget.java b/rapidoid-pages/src/main/java/org/rapidoid/widget/PagerWidget.java index <HASH>..<HASH> 100644 --- a/rapidoid-pages/src/main/java/org/rapidoid/widget/PagerWidget.java +++ b/rapidoid-pages/src/main/java/org/rapidoid/widget/PagerWidget.java @@ -47,7 +47,11 @@ public class PagerWidget extends AbstractWidget { Tag next = next().navigate("_inc", pageNumber, 1); Tag last = last().navigate("_set", pageNumber, to); - return pagination(first, prev, current, next, last); + return shouldDisplay() ? pagination(first, prev, current, next, last) : div(); + } + + protected boolean shouldDisplay() { + return to > 1; } protected Tag pagination(Tag first, Tag prev, Tag current, Tag next, Tag last) {
Improved pager - display only when more than 1 page is available.
rapidoid_rapidoid
train
java
aa3a13e334c8fee78058575e7671a53d9c2c2e87
diff --git a/src/yimaTheme/Manager/DefaultListenerAggregate.php b/src/yimaTheme/Manager/DefaultListenerAggregate.php index <HASH>..<HASH> 100644 --- a/src/yimaTheme/Manager/DefaultListenerAggregate.php +++ b/src/yimaTheme/Manager/DefaultListenerAggregate.php @@ -158,7 +158,7 @@ class DefaultListenerAggregate extends Manager implements $themeLocator = $this->getThemeLocator(); $preparedTheme = $this->manager->getThemeObject(); if (!$preparedTheme) { - // we are not attained theme name + // we are not attained theme return; } @@ -200,6 +200,10 @@ class DefaultListenerAggregate extends Manager implements // load widgets into { $themeObject = $this->manager->getThemeObject(); + if (!$themeObject) { + // we are not attained theme + return; + } $sm = $this->sm;
fix theme manager issue on not detected themes
YiMAproject_yimaTheme
train
php
d54e825506d740ad12d6fe0a9d83b5172401f79b
diff --git a/lib/beaker-vmpooler/version.rb b/lib/beaker-vmpooler/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-vmpooler/version.rb +++ b/lib/beaker-vmpooler/version.rb @@ -1,3 +1,3 @@ module BeakerVmpooler - VERSION = '1.3.2' + VERSION = '1.3.3' end
(GEM) update beaker-vmpooler version to <I>
puppetlabs_beaker-vmpooler
train
rb
9b835f70b61785847e842004337751f9bde67768
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index <HASH>..<HASH> 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1465,6 +1465,14 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012111200.00); } + if ($oldversion < 2012111200.01) { + // Force the rebuild of the cache of every courses, some cached information could contain wrong icon references. + rebuild_course_cache(); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2012111200.01); + } + return true; } diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012111200.00; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012111200.01; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes
MDL-<I> upgrade: Force courses cache to be rebuilt
moodle_moodle
train
php,php
d486abb8b85cd7799c0340ef8b5fc794d016ca73
diff --git a/src/Illuminate/Support/Arr.php b/src/Illuminate/Support/Arr.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Support/Arr.php +++ b/src/Illuminate/Support/Arr.php @@ -110,9 +110,10 @@ class Arr { foreach ($array as $value) { - $value = (array) $value; - - $results[] = $value[$segment]; + if (array_key_exists($segment, $value = (array) $value)) + { + $results[] = $value[$segment]; + } } $array = array_values($results); diff --git a/tests/Support/SupportHelpersTest.php b/tests/Support/SupportHelpersTest.php index <HASH>..<HASH> 100755 --- a/tests/Support/SupportHelpersTest.php +++ b/tests/Support/SupportHelpersTest.php @@ -133,6 +133,8 @@ class SupportHelpersTest extends PHPUnit_Framework_TestCase { ), array_fetch($data, 'comments')); $this->assertEquals(array(array('#foo', '#bar'), array('#baz')), array_fetch($data, 'comments.tags')); + $this->assertEquals([], array_fetch($data, 'foo')); + $this->assertEquals([], array_fetch($data, 'foo.bar')); }
Ensure we can fetch an array with non existing keys
laravel_framework
train
php,php
bdb6fef44e5103690cc7372940b7cc417fcd816a
diff --git a/spec/filter_spec.rb b/spec/filter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/filter_spec.rb +++ b/spec/filter_spec.rb @@ -199,7 +199,7 @@ describe Philtre::Filter do end it 'not_blank' do - field = Sequel.expr Faker::Lorem.word + field = Faker::Lorem.word expr = described_class.predicates.call :"#{field}_not_blank", Faker::Lorem.word expr.op.should == :AND @@ -213,7 +213,7 @@ describe Philtre::Filter do end it 'blank' do - field = Sequel.expr Faker::Lorem.word + field = Faker::Lorem.word expr = described_class.predicates.call :"#{field}_blank", Faker::Lorem.word expr.op.should == :OR
don't pass Sequel::Sql::Expression as a field name in specs
djellemah_philtre
train
rb
46a6a99b73f5d8e77b9711b9763dc711d20e40f3
diff --git a/src/clappr-dash-shaka-playback.js b/src/clappr-dash-shaka-playback.js index <HASH>..<HASH> 100644 --- a/src/clappr-dash-shaka-playback.js +++ b/src/clappr-dash-shaka-playback.js @@ -121,10 +121,8 @@ class DashShakaPlayback extends HTML5Video { } pause() { - super.pause() - - if (this.dvrEnabled) - this._updateDvr(true) + this.el.pause() + this.dvrEnabled && this._updateDvr(true) } play () {
refactor: overwrite pause method
clappr_dash-shaka-playback
train
js
5c240fd5f1c2a90a1cd79ae10f6d3d7d4c970004
diff --git a/sshtunnel.py b/sshtunnel.py index <HASH>..<HASH> 100644 --- a/sshtunnel.py +++ b/sshtunnel.py @@ -610,15 +610,16 @@ class SSHTunnelForwarder(object): .format(ssh_config_file)) if not ssh_password: - ssh_private_key = paramiko.RSAKey.from_private_key_file( - ssh_private_key, - password=ssh_private_key_password - ) if ssh_private_key else None - # Check if a private key was supplied or found in ssh_config if not ssh_private_key: raise ValueError('No password or private key available!') + if isinstance(ssh_private_key, string_types): + ssh_private_key = paramiko.RSAKey.from_private_key_file( + ssh_private_key, + password=ssh_private_key_password + ) + if not ssh_port: ssh_port = 22
Support paramiko PKey as ssh_private_key
pahaz_sshtunnel
train
py
4dd5ce92623aa0c85855bc451a48092862b7458f
diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index <HASH>..<HASH> 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -12,10 +12,11 @@ describe Rscons do end def test_dir(build_test_directory) - Dir.chdir("build_tests_run/#{build_test_directory}") + dir = "build_tests_run/#{build_test_directory}" if File.exists?('build.rb') - system('ruby build.rb') + system("ruby -r rscons -C #{dir} build.rb") end + Dir.chdir(dir) end ###########################################################################
require rscons when running build test in a ruby subprocess
holtrop_rscons
train
rb
e5069d3c3c3a8af677e89e675a04ebcf9785a7e7
diff --git a/src/Guzzle/Http/Client.php b/src/Guzzle/Http/Client.php index <HASH>..<HASH> 100644 --- a/src/Guzzle/Http/Client.php +++ b/src/Guzzle/Http/Client.php @@ -478,9 +478,10 @@ class Client extends AbstractHasDispatcher implements ClientInterface } /** - * Copy the cecert.pem file from the phar if it is not in the temp folder + * Copy the cecert.pem file from the phar if it is not in the temp folder and validate the MD5 checksum * - * @throws RuntimeException if the file cannot be copied + * @return string + * @throws RuntimeException if the file cannot be copied or there is a MD5 mismatch */ protected function preparePharCacert() {
Updating docblock for preparePharCacert
guzzle_guzzle3
train
php
5b88bc6fe1c62fec42090155126cf6e193a3f9e1
diff --git a/simple_unit_tests.py b/simple_unit_tests.py index <HASH>..<HASH> 100644 --- a/simple_unit_tests.py +++ b/simple_unit_tests.py @@ -157,4 +157,9 @@ class TestParseAction(PyparsingExpressionTestCase): if __name__ == '__main__': + # we use unittest features that are in Py3 only, bail out if run on Py2 + import sys + if sys.version_info[0] < 3: + sys.exit(0) + unittest.main() \ No newline at end of file
simple_unit_tests.py only runs on Py3
pyparsing_pyparsing
train
py
ebc595fc69e0c1ddf96ace6c822a257acd56cff2
diff --git a/lib/logger.js b/lib/logger.js index <HASH>..<HASH> 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -72,7 +72,8 @@ define( info.push(elemToString(elem)); info.push(component.constructor.describe.split(' ').slice(0,3).join(' ')); console.groupCollapsed && action == 'trigger' && console.groupCollapsed(action, name); - console.info.apply(console, info); + // IE9 doesn't define `apply` for console methods, but this works everywhere: + Function.prototype.apply.call(console.info, console, info); } }
console.info.apply fix for IE9 Logging was breaking in IE9 because console.info.apply is undefined (even when dev tools is open and console.info is defined). See: <URL>
flightjs_flight
train
js
f38792ef0590113ee54bd1fc09e4379b29460039
diff --git a/admin/webservice/forms.php b/admin/webservice/forms.php index <HASH>..<HASH> 100644 --- a/admin/webservice/forms.php +++ b/admin/webservice/forms.php @@ -112,7 +112,7 @@ class external_service_form extends moodleform { $mform->setType('id', PARAM_INT); if (!empty($service->id)) { - $buttonlabel = get_string('editaservice', 'webservice'); + $buttonlabel = get_string('savechanges'); } else { $buttonlabel = get_string('addaservice', 'webservice'); }
MDL-<I> rename 'Edit service' to 'Save changes'
moodle_moodle
train
php
ac555053fea84aa2f2a364ceb1e8adf5fc41fff8
diff --git a/src/actions.js b/src/actions.js index <HASH>..<HASH> 100644 --- a/src/actions.js +++ b/src/actions.js @@ -14,7 +14,7 @@ export function dispatchGlobalEvent(eventName, opts, target = window) { if (typeof window.CustomEvent === 'function') { event = new window.CustomEvent(eventName, { detail: opts }); } else { - event = document.createEvent('Event'); + event = document.createEvent('CustomEvent'); event.initCustomEvent(eventName, false, true, opts); }
Fix for IE<I> custom event
vkbansal_react-contextmenu
train
js
5134e180c999e77cb1d5c7fce07644ec847f1b90
diff --git a/src/test/org/openscience/cdk/tools/diff/tree/IntegerDifferenceTest.java b/src/test/org/openscience/cdk/tools/diff/tree/IntegerDifferenceTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/tools/diff/tree/IntegerDifferenceTest.java +++ b/src/test/org/openscience/cdk/tools/diff/tree/IntegerDifferenceTest.java @@ -58,4 +58,11 @@ public class IntegerDifferenceTest extends CDKTestCase { Assert.assertNotNull(diffString); assertOneLiner(diffString); } + + @Test public void testRefs() { + Integer x = new Integer(1); + Integer y = new Integer(1); + IDifference diff = IntegerDifference.construct("foo", x, y); + Assert.assertNull(diff); + } }
Added a test to ensure that Integer objects are compared by value rather than reference
cdk_cdk
train
java
37a67c1b229e0baf8b6a5a9f0dc83f13373a4b48
diff --git a/beanstalkc.py b/beanstalkc.py index <HASH>..<HASH> 100644 --- a/beanstalkc.py +++ b/beanstalkc.py @@ -53,7 +53,7 @@ class Connection(object): self.socket.close() def _interact(self, command, expected_ok, expected_err=[]): - self.socket.send(command) + self.socket.sendall(command) status, results = self._read_response() if status in expected_ok: return results
Use socket#sendall to fail faster
earl_beanstalkc
train
py
58e05f72a1f11dc42e62871cbe4e9ec14372a4e0
diff --git a/src/Env/index.js b/src/Env/index.js index <HASH>..<HASH> 100644 --- a/src/Env/index.js +++ b/src/Env/index.js @@ -75,7 +75,7 @@ class Env { _.each(matches, (match) => { const key = match.replace(/\$|{|}/g, '') const variable = envConfig[key] || process.env[key] || '' - env = env.replace(match, this._interpolate(variable)) + env = env.replace(match, this._interpolate(variable, envConfig)) }) return env }
fix(env): ensure envConfig is used to interpolate env file (#<I>)
adonisjs_adonis-framework
train
js