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
699a609123963bc07782b62f3719e054dd97fe0d
diff --git a/vm/src/VM.js b/vm/src/VM.js index <HASH>..<HASH> 100644 --- a/vm/src/VM.js +++ b/vm/src/VM.js @@ -59,7 +59,9 @@ luajs.VM.prototype._bindLib = function (lib) { result[i] = this._bindLib(lib[i]); } else if (typeof lib[i] == 'function') { - result[i] = lib[i].bind(this); + result[i] = (function (func, context) { + return function () { return func.apply(context, arguments); }; + })(lib[i], this); } else { result[i] = lib[i];
Removed the use of Function.bind() for backwards compatibility.
gamesys_moonshine
train
js
029e3555b7474e897d15398b6a30324a8ac1d87e
diff --git a/attribute.go b/attribute.go index <HASH>..<HASH> 100644 --- a/attribute.go +++ b/attribute.go @@ -214,7 +214,7 @@ func (ad *AttributeDecoder) Next() bool { // pointed to by the decoder. // // Type masks off the high bits of the netlink attribute type which may contain -// the Nested and NetByteOrder flags. These can be obtained by calling TypeFlags(). +// the Nested and NetByteOrder flags. These can be obtained by calling TypeFlags. func (ad *AttributeDecoder) Type() uint16 { // Mask off any flags stored in the high bits. return ad.a.Type & attrTypeMask @@ -224,7 +224,7 @@ func (ad *AttributeDecoder) Type() uint16 { // netlink attribute pointed to by the decoder. // // These bits of the netlink attribute type are used for the Nested and NetByteOrder -// flags. +// flags, available as the Nested and NetByteOrder constants in this package. func (ad *AttributeDecoder) TypeFlags() uint16 { return ad.a.Type & ^attrTypeMask }
Remove parens from TypeFlags in docs, mention Nested and NetByteOrder constants
mdlayher_netlink
train
go
352dd71aa3d3db6219f65f2a1f4879c2450c6a9e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -293,6 +293,7 @@ function getPathValue(obj, path) { function setPathValue(obj, path, val) { var parsed = parsePath(path); internalSetPathValue(obj, val, parsed); + return obj; } module.exports = { diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -208,4 +208,10 @@ describe('setPathValue', function () { assert(obj.hello[1] === 2); assert(obj.hello[2] === 3); }); + + it('returns the object in which the value was set', function () { + var obj = { hello: [ 1, 2, 4 ] }; + var valueReturned = pathval.setPathValue(obj, 'hello[2]', 3); + assert(obj === valueReturned); + }); });
feat: returns the object in which the value was set. Closes #6
chaijs_pathval
train
js,js
286437f1e2c8e803831cb229a125a99852fc2ac7
diff --git a/libkbfs/config_local.go b/libkbfs/config_local.go index <HASH>..<HASH> 100644 --- a/libkbfs/config_local.go +++ b/libkbfs/config_local.go @@ -1465,9 +1465,7 @@ func (c *ConfigLocal) SetKBFSService(k *KBFSService) { func (c *ConfigLocal) RootNodeWrappers() []func(Node) Node { c.lock.RLock() defer c.lock.RUnlock() - ret := make([]func(Node) Node, len(c.rootNodeWrappers)) - copy(ret, c.rootNodeWrappers) - return ret + return c.rootNodeWrappers[:] } // AddRootNodeWrapper implements the Config interface for ConfigLocal.
config_local: use simpler method to return root wrappers Suggested by jzila. Issue: #<I>
keybase_client
train
go
09f6ab55101b6db9302e1fbcd139f5c47e39c0ff
diff --git a/src/playbacks/hls/hls.js b/src/playbacks/hls/hls.js index <HASH>..<HASH> 100644 --- a/src/playbacks/hls/hls.js +++ b/src/playbacks/hls/hls.js @@ -67,7 +67,8 @@ export default class HLS extends HTML5VideoPlayback { this.hls.swapAudioCodec() this.hls.recoverMediaError() } else { - // failed recovery + Log.error("hlsjs: failed to recover") + this.trigger(Events.PLAYBACK_ERROR, `hlsjs: could not recover from error, evt ${evt}, data ${data} `, this.name) } } @@ -147,6 +148,7 @@ export default class HLS extends HTML5VideoPlayback { this.recover() break default: + Log.error(`hlsjs: trying to recover from media error, evt ${evt}, data ${data} `) this.trigger(Events.PLAYBACK_ERROR, `hlsjs: could not recover from error, evt ${evt}, data ${data} `, this.name) break }
hlsjs: triggers an error when fail to recover
clappr_clappr
train
js
0924bde744f4156085ef303c574ff3e01a30487e
diff --git a/angr/state_plugins/preconstrainer.py b/angr/state_plugins/preconstrainer.py index <HASH>..<HASH> 100644 --- a/angr/state_plugins/preconstrainer.py +++ b/angr/state_plugins/preconstrainer.py @@ -60,7 +60,11 @@ class SimStatePreconstrainer(SimStatePlugin): "claripy replacement backend.", variable) l.warning("Please use a leaf AST as the preconstraining variable instead.") - constraint = variable == value + # Add the constraint with a simplification avoidance tag. If + # this is not added, claripy may simplify new constraints if + # they are redundant with respect to the preconstraints. This + # is problematic when the preconstraints are removed. + constraint = (variable == value).annotate(claripy.SimplificationAvoidanceAnnotation()) l.debug("Preconstraint: %s", constraint) # add the constraint for reconstraining later
Preconstraints should not be simplified away (#<I>)
angr_angr
train
py
0b9fb87b45736d68c874e557f16689aa79caa18a
diff --git a/lib/reveal-ck/templates/processor.rb b/lib/reveal-ck/templates/processor.rb index <HASH>..<HASH> 100644 --- a/lib/reveal-ck/templates/processor.rb +++ b/lib/reveal-ck/templates/processor.rb @@ -1,7 +1,7 @@ # # Setup Slim require 'slim' -::Slim::Engine.set_default_options pretty: true +::Slim::Engine.set_options pretty: true require 'tilt'
[dependencies, slim] Start using set_options When I jumped versions of slim, I saw that what I was using was deprecated: ``` set_default_options has been deprecated, use set_options ```
jedcn_reveal-ck
train
rb
cf0e1e3a931bbcb43687b4887517346fc3a1b766
diff --git a/fbchat/_session.py b/fbchat/_session.py index <HASH>..<HASH> 100644 --- a/fbchat/_session.py +++ b/fbchat/_session.py @@ -246,7 +246,9 @@ class Session: on_2fa_callback: Function that will be called, in case a two factor authentication code is needed. This should return the requested code. - Only tested using SMS, might not work with authentication applications. + Tested using SMS and authentication applications. If you have both + enabled, you might not receive an SMS code, and you'll have to use the + authentication application. Note: Facebook limits the amount of codes they will give you, so if you don't receive a code, be patient, and try again later!
Test on_2fa_callback with authentication applications
carpedm20_fbchat
train
py
e0bbc9cab74e03f2c83fd39294b7648e7b8f282b
diff --git a/src/synapse/azext_synapse/_validators.py b/src/synapse/azext_synapse/_validators.py index <HASH>..<HASH> 100644 --- a/src/synapse/azext_synapse/_validators.py +++ b/src/synapse/azext_synapse/_validators.py @@ -20,7 +20,7 @@ def validate_statement_language(namespace): statement_language = { 'spark': 'spark', 'scala': 'spark', - 'pypark': 'pyspark', + 'pyspark': 'pyspark', 'python': 'pyspark', 'sparkdotnet': 'sparkdotnet', 'csharp': 'sparkdotnet',
Fixed a typo in validator (#<I>)
Azure_azure-cli-extensions
train
py
21c5f95494c92aad2fc3919fdfb86c868fbd2bda
diff --git a/art/art.py b/art/art.py index <HASH>..<HASH> 100644 --- a/art/art.py +++ b/art/art.py @@ -220,10 +220,10 @@ def tsave( raise Exception(TEXT_TYPE_ERROR) files_list = os.listdir(os.getcwd()) extension = ".txt" - splited_filename = filename.split(".") - name = splited_filename[0] - if len(splited_filename) > 1: - extension = "." + splited_filename[1] + splitted_filename = filename.split(".") + name = splitted_filename[0] + if len(splitted_filename) > 1: + extension = "." + splitted_filename[1] index = 2 test_name = name while(True):
fix : minor typo in tsave fixed
sepandhaghighi_art
train
py
306cc39aeca58e5f7299e51aadbde7605443f818
diff --git a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java index <HASH>..<HASH> 100644 --- a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java +++ b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java @@ -29,7 +29,6 @@ import com.netflix.hystrix.strategy.concurrency.HystrixContextScheduler; import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext; import com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHook; import com.netflix.hystrix.strategy.properties.HystrixProperty; -import com.sun.javafx.collections.NonIterableChange; import org.junit.After; import org.junit.Rule; import org.junit.Test;
Removed bad import that snuck in
Netflix_Hystrix
train
java
fe4dcd8b5985084462f1ee6e5e9887a8975bf18e
diff --git a/lib/puppet/parser/type_loader.rb b/lib/puppet/parser/type_loader.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/parser/type_loader.rb +++ b/lib/puppet/parser/type_loader.rb @@ -126,16 +126,16 @@ class Puppet::Parser::TypeLoader # Utility method factored out of load for handling thread-safety. # This isn't tested in the specs, because that's basically impossible. - def import_if_possible(file) + def import_if_possible(file, &blk) return if @loaded.include?(file) begin case @loading.owner_of(file) when :this_thread return when :another_thread - return import_if_possible(file) + return import_if_possible(file, &blk) when :nobody - yield + blk.call end rescue Puppet::ImportError => detail # We couldn't load the item
[#<I>] Missing parameter breaks multithread compilation import_if_possible calls itself recursively, but it was failing to pass its block parameter to its younger self. Thus when the inner call reached the un-blocked case, it raised an exception rather than doing something useful.
puppetlabs_puppet
train
rb
899d3f4bb20441393182c3a5690566705e6b91aa
diff --git a/alot/ui.py b/alot/ui.py index <HASH>..<HASH> 100644 --- a/alot/ui.py +++ b/alot/ui.py @@ -487,8 +487,8 @@ class UI(object): :rtype: :class:`twisted.defer.Deferred` """ choices = choices or {'y': 'yes', 'n': 'no'} - assert select in choices.values() + [None] - assert cancel in choices.values() + [None] + assert select is None or select in choices.itervalues() + assert cancel is None or cancel in choices.itervalues() assert msg_position in ['left', 'above'] d = defer.Deferred() # create return deferred
ui: Don't build lists in memory for assert This patch changes an assertion to avoid building a list in memory by using dict.keys() and then concatenating it (building a second list in memory). This is both faster and uses less memory.
pazz_alot
train
py
200b6fc9e1109e47aed13a80f0fbe3e217698dd1
diff --git a/lib/sneakers_packer/rpc_client.rb b/lib/sneakers_packer/rpc_client.rb index <HASH>..<HASH> 100644 --- a/lib/sneakers_packer/rpc_client.rb +++ b/lib/sneakers_packer/rpc_client.rb @@ -8,6 +8,7 @@ module SneakersPacker def initialize(publisher) @publisher = publisher channel, exchange = fetch_channel_and_exchange + @queue_name = "rpc.#{SecureRandom.uuid}" @consumer = build_reply_queue(channel, exchange) end @@ -49,13 +50,15 @@ module SneakersPacker exchange = nil @publisher.instance_eval do - # ensure_connection connection first - @mutex.synchronize do - unless connected? - ensure_connection! - reconnected = true - channel = @channel - exchange = @exchange + if @bunny.nil? || !@bunny.automatically_recover? + # ensure_connection connection first + @mutex.synchronize do + unless connected? + ensure_connection! + reconnected = true + channel = @channel + exchange = @exchange + end end end end @@ -69,7 +72,7 @@ module SneakersPacker def build_reply_queue(channel, exchange) @channel, @exchange = channel, exchange - @reply_queue = channel.queue("", exclusive: true) + @reply_queue = channel.queue(@queue_name, exclusive: true) @reply_queue.bind(exchange, routing_key: @reply_queue.name) @lock = Mutex.new
Support automatically_recover of RabbitMQ for rpc. There is a problem when RabbitMQ reconnecting using rpc. Rpc client uses a RabbitMQ generated queue for response. The recovering binding for generated queue dosn't work when RabbitMQ reconnecting. It cause rpc client not working also. I fix it by replacing RabbitMQ generated queue with self generated queue.
xiewenwei_sneakers_packer
train
rb
46bdf225d61051e9f4667bd528dd87716dc01795
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -28,6 +28,8 @@ class UpdateHtaccessLocationsTask(Task): Updates locations of .htaccess with new IPs. """ def run(self, **kwargs): + logger.info('UpdateHtaccessLocationsTask was called') + # the regex patterns pattern0 = 'SetEnvIF REMOTE_ADDR ".*" DenyAccess' pattern1 = 'SetEnvIF X-FORWARDED-FOR ".*" DenyAccess'
more logging, refs #<I>
dArignac_ip_assembler
train
py
f8d85c1b4de8a6987446e984885fc111ae4a001b
diff --git a/gin.go b/gin.go index <HASH>..<HASH> 100644 --- a/gin.go +++ b/gin.go @@ -83,6 +83,7 @@ var ( // Allows type H to be used with xml.Marshal func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name = xml.Name{"", "map"} if err := e.EncodeToken(start); err != nil { return err } @@ -91,11 +92,11 @@ func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error { xml.Name{"", key}, []xml.Attr{}, } - if err = e.EncodeElement(value, elem); err != nil { + if err := e.EncodeElement(value, elem); err != nil { return err } } - if err = e.EncodeToken(xml.EndElement{start.Name}); err != nil { + if err := e.EncodeToken(xml.EndElement{start.Name}); err != nil { return err } return nil
Fixes MarshalXML() and renames initial "H" tag to "map".
gin-gonic_gin
train
go
c5a9383fc94ae96e568eed057ed71d49928e3c49
diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py index <HASH>..<HASH> 100644 --- a/salt/states/saltmod.py +++ b/salt/states/saltmod.py @@ -79,6 +79,9 @@ def state( ssh Set to `True` to use the ssh client instaed of the standard salt client + roster + In the event of using salt-ssh, a roster system can be set + fail_minions An optional list of targeted minions where failure is an option '''
Add roster doc to salt.state runner
saltstack_salt
train
py
44bfbbf15b2c763eb0b035da793ea198ab12dc47
diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index <HASH>..<HASH> 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -264,7 +264,6 @@ class AsyncZeroMQPubChannel(salt.transport.mixins.auth.AESPubClientMixin, salt.t else: self._socket.setsockopt(zmq.SUBSCRIBE, '') - self._socket.setsockopt(zmq.SUBSCRIBE, '') self._socket.setsockopt(zmq.IDENTITY, self.opts['id']) # TODO: cleanup all the socket opts stuff
Removes suspected copy/paste error. Subscribing to ‘’ empty topic regardless of zmq_filtering setting breaks function.
saltstack_salt
train
py
039cb78c8267c0776a4a127dcf303a270073de6f
diff --git a/cassandra/cluster.py b/cassandra/cluster.py index <HASH>..<HASH> 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -183,16 +183,10 @@ def _shutdown_clusters(): atexit.register(_shutdown_clusters) -# murmur3 implementation required for TokenAware is only available for CPython -import platform -if platform.python_implementation() == 'CPython': - def default_lbp_factory(): - if murmur3 is not None: - return TokenAwarePolicy(DCAwareRoundRobinPolicy()) - return DCAwareRoundRobinPolicy() -else: - def default_lbp_factory(): - return DCAwareRoundRobinPolicy() +def default_lbp_factory(): + if murmur3 is not None: + return TokenAwarePolicy(DCAwareRoundRobinPolicy()) + return DCAwareRoundRobinPolicy() class ExecutionProfile(object):
TokenAwarePolicy can be default with PyPy implementation as well
datastax_python-driver
train
py
d57afef85221e9c2ee09e94472f0bcc5e5ac5de1
diff --git a/build.js b/build.js index <HASH>..<HASH> 100755 --- a/build.js +++ b/build.js @@ -70,11 +70,6 @@ var buildSteps = [ // build all if no args are passed argv.a = argv.a || process.argv.length == 2; -// setup queue for release -if (argv.release) { - argv['release-sdk'] = argv.j = argv.y = true; -} - // these have to be optionally inserted since we don't want them executing if // -a is passed if (argv['release-docs']) { @@ -357,8 +352,12 @@ function release() { console.log('Ready to commit/tag'); } }); - // run the queue - nextStep(); + + // make sure these steps are run + argv.j = argv.y = argv.l = true; + + // run the queue by starting with releaseSdk + releaseSdk(argv.release); } }); } else {
prepping build.js for --release option
OpenF2_F2
train
js
fa1d32382bf74838efc360eed9be1362809c7f30
diff --git a/test/integration_helper.rb b/test/integration_helper.rb index <HASH>..<HASH> 100644 --- a/test/integration_helper.rb +++ b/test/integration_helper.rb @@ -67,8 +67,11 @@ module IntegrationHelper false end + def open(url) + super("http://127.0.0.1:#{port}#{url}") + end + def get(url) - url = "http://127.0.0.1:#{port}#{url}" open(url).read end @@ -126,6 +129,7 @@ module IntegrationHelper def self.extend_object(obj) super + base_port = 5000 + Process.pid % 100 Sinatra::Base.server.each_with_index do |server, index| Server.run(server, 5000+index) end
use PID for port (so two tests can run in parallel) pull requests for better logic welcome
sinatra_sinatra
train
rb
542e86c22870cc8ddcc3c6a2c328654e00a7775f
diff --git a/sessions.js b/sessions.js index <HASH>..<HASH> 100644 --- a/sessions.js +++ b/sessions.js @@ -49,10 +49,11 @@ class ClientSession { this.topology.command( 'admin.$cmd', { endSessions: 1, ids: [this.id] }, - { readPreference: ReadPreference.primaryPreferred } + { readPreference: ReadPreference.primaryPreferred }, + () => { + // intentionally ignored, per spec + } ); - - return; } this.hasEnded = true;
refactor(endSession): don't return if topology command is run NODE-<I>
mongodb_node-mongodb-native
train
js
e6c5dcbe670967297b35760788ac0df84a5502b7
diff --git a/src/ValidatingModel.php b/src/ValidatingModel.php index <HASH>..<HASH> 100644 --- a/src/ValidatingModel.php +++ b/src/ValidatingModel.php @@ -1,9 +1,9 @@ <?php namespace Watson\Validating; use \Illuminate\Database\Eloquent\Model as Eloquent; -use \Illuminate\Support\Contracts\MessageProviderInterface; +use \Illuminate\Contracts\Support\MessageProvider; -abstract class ValidatingModel extends Eloquent implements MessageProviderInterface, ValidatingInterface { +abstract class ValidatingModel extends Eloquent implements MessageProvider, ValidatingInterface { /** * Make model validate attributes.
Updated interface to new contract (#<I>)
dwightwatson_validating
train
php
2b724585fdc246bd21f4e5b8b2d60823a61f61ec
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -37,7 +37,7 @@ const KAFKA_VERSION = '5.4.0'; const JACKSON_DATABIND_NULLABLE_VERSION = '0.2.1'; // Version of docker images -const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v6.0.2'; +const DOCKER_JHIPSTER_REGISTRY = 'jhipster/jhipster-registry:v6.1.1'; const DOCKER_JAVA_JRE = 'adoptopenjdk:11-jre-hotspot'; const DOCKER_MYSQL = 'mysql:8.0.19'; const DOCKER_MARIADB = 'mariadb:10.4.11';
Upgrade to jhipster-registry <I>
jhipster_generator-jhipster
train
js
a33aa912898c4f1c2355f7f2e1e7935bbd07be1e
diff --git a/openquake/engine/calculators/risk/hazard_getters.py b/openquake/engine/calculators/risk/hazard_getters.py index <HASH>..<HASH> 100644 --- a/openquake/engine/calculators/risk/hazard_getters.py +++ b/openquake/engine/calculators/risk/hazard_getters.py @@ -193,7 +193,7 @@ class GroundMotionValuesGetter(HazardGetter): cursor = models.getcursor('job_init') cursor.execute('select site_id, rupture_ids, gmvs from ' 'hzrdr.gmf_data where gmf_id=%s and site_id in %s ' - 'and {} order by site_id, task_no'.format(imt_query), + 'and {} order by site_id'.format(imt_query), (gmf_id, tuple(self.site_ids), imt_type, sa_period, sa_damping)) for sid, group in itertools.groupby(cursor, operator.itemgetter(0)):
Removed the fake dependency on task_no from the hazard_getters
gem_oq-engine
train
py
f06317f3f321340f4b916caa42da4d24f447ef34
diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index <HASH>..<HASH> 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -602,6 +602,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi): * Pmp : Power at maximum-power point (W) * Ix : Current at module V = 0.5Voc, defines 4th point on I-V curve for modeling curve shape * Ixx : Current at module V = 0.5(Voc+Vmp), defines 5th point on I-V curve for modeling curve shape + * Ee : Effective irradiance Notes ----- @@ -689,6 +690,8 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi): (module['C6']*Ee + module['C7']*(Ee**2)) * (1 + module['Aisc']*(temp_cell - T0)) ) + dfout['Ee'] = Ee + return dfout
add effective irradiance to sapm output
pvlib_pvlib-python
train
py
89c209a5a559b0032e6a8e1916ccf47c7c66bb32
diff --git a/actor-apps/app-web/src/app/components/Login.react.js b/actor-apps/app-web/src/app/components/Login.react.js index <HASH>..<HASH> 100644 --- a/actor-apps/app-web/src/app/components/Login.react.js +++ b/actor-apps/app-web/src/app/components/Login.react.js @@ -163,6 +163,7 @@ class Login extends React.Component { Actor Messenger © 2015 </div> <div className="pull-right"> + <a href="//actorapp.ghost.io/desktop-apps">Desktop</a> <a href="//actor.im/ios">iPhone</a> <a href="//actor.im/android">Android</a> </div>
feat(web): add links to desktop app to login page
actorapp_actor-platform
train
js
80f7fa7f796a7fc90106fdec77e81249f4e92bb3
diff --git a/gridfs/__init__.py b/gridfs/__init__.py index <HASH>..<HASH> 100644 --- a/gridfs/__init__.py +++ b/gridfs/__init__.py @@ -177,7 +177,7 @@ class GridFS(object): for key, value in kwargs.iteritems(): query[key] = value - cursor = self.__files.find(query, {"_id": True}) + cursor = self.__files.find(query, ["_id"]) if version < 0: skip = abs(version) - 1 cursor.limit(-1).skip(skip).sort("uploadDate", DESCENDING)
be consistent with how we limit fields in other methods
mongodb_mongo-python-driver
train
py
deb68e7336ad8f308ba69cfc0148fcdeb2ab0803
diff --git a/pygal/style.py b/pygal/style.py index <HASH>..<HASH> 100644 --- a/pygal/style.py +++ b/pygal/style.py @@ -278,7 +278,8 @@ styles = {'default': DefaultStyle, 'green': LightGreenStyle, 'dark_green': DarkGreenStyle, 'dark_green_blue': DarkGreenBlueStyle, - 'blue': BlueStyle} + 'blue': BlueStyle, + 'solid_color': SolidColorStyle} parametric_styles = {}
Added new style - SolidColorStyle
Kozea_pygal
train
py
f2cfa97291aa57200ca187bd4819babbaa495bca
diff --git a/lib/bento_search/version.rb b/lib/bento_search/version.rb index <HASH>..<HASH> 100644 --- a/lib/bento_search/version.rb +++ b/lib/bento_search/version.rb @@ -1,3 +1,3 @@ module BentoSearch - VERSION = "1.2.0" + VERSION = "1.2.1" end
version <I> -- gemspec allows rails4, test env changed to test under rails4, no other changes needed for rails4 support
jrochkind_bento_search
train
rb
6a7120aa74b34ec82e0b1099b644f5bdfada3988
diff --git a/django_extensions/management/commands/sync_media_s3.py b/django_extensions/management/commands/sync_media_s3.py index <HASH>..<HASH> 100644 --- a/django_extensions/management/commands/sync_media_s3.py +++ b/django_extensions/management/commands/sync_media_s3.py @@ -37,7 +37,6 @@ import optparse import os import sys import time - from django.core.management.base import BaseCommand, CommandError # Make sure boto is available @@ -109,6 +108,8 @@ class Command(BaseCommand): else: if not settings.MEDIA_ROOT: raise CommandError('MEDIA_ROOT must be set in your settings.') + + self.FILTER_LIST = getattr(settings, 'FILTER_LIST', self.FILTER_LIST) self.DIRECTORY = settings.MEDIA_ROOT self.verbosity = int(options.get('verbosity'))
allow FILTER_LIST to be overridden
django-extensions_django-extensions
train
py
8ce9f194bbc23a838c1a7b120e047228dc4c7844
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -165,6 +165,8 @@ class Application extends Silex\Application $this['db']->connect(); // A ConnectionException or DriverException could be thrown, we'll catch DBALException to be safe. } catch (DBALException $e) { + $this['logger.system']->debug($e->getMessage(), ['event' => 'exception', 'exception' => $e]); + // Trap double exceptions caused by throwing a new LowlevelException set_exception_handler(['\Bolt\Exception\LowlevelException', 'nullHandler']);
Send DBAL connection exceptions to the debug logger
bolt_bolt
train
php
e3bcfc7dd6da8885b8036d508a230c9e9472fa77
diff --git a/sling/core/console/src/main/resources/root/libs/composum/sling/console/browser/js/nodeview.js b/sling/core/console/src/main/resources/root/libs/composum/sling/console/browser/js/nodeview.js index <HASH>..<HASH> 100644 --- a/sling/core/console/src/main/resources/root/libs/composum/sling/console/browser/js/nodeview.js +++ b/sling/core/console/src/main/resources/root/libs/composum/sling/console/browser/js/nodeview.js @@ -684,7 +684,7 @@ */ onReload: function() { browser.getBreadcrumbs(); - this.favoriteToggle = this.$detailView.find('> .favorite-toggle'); + this.favoriteToggle = this.$detailView.find('.favorite-toggle'); this.checkFavorite(); this.favoriteToggle.click(_.bind(this.toggleFavorite, this)); },
detail view generalization - fix for the favorite toggle issue
ist-dresden_composum
train
js
8a097cd646086db54339a6d437e3cec5b7f1a7a4
diff --git a/athenacli/__init__.py b/athenacli/__init__.py index <HASH>..<HASH> 100644 --- a/athenacli/__init__.py +++ b/athenacli/__init__.py @@ -1,2 +1 @@ - -__version__ = '1.6.2' +__version__ = '1.6.3'
Releasing version <I>
dbcli_athenacli
train
py
9e1b961d3264875b8b1006b76af15a806a9b42d9
diff --git a/quark/plugin.py b/quark/plugin.py index <HASH>..<HASH> 100644 --- a/quark/plugin.py +++ b/quark/plugin.py @@ -767,3 +767,9 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2): filter(models.IPAddress.id == id).\ first() return self._make_ip_dict(addr) + + def create_ip_address(self): + raise NotImplemented() + + def update_ip_address(self): + raise NotImplemented() diff --git a/quark/tests/test_quark_plugin.py b/quark/tests/test_quark_plugin.py index <HASH>..<HASH> 100644 --- a/quark/tests/test_quark_plugin.py +++ b/quark/tests/test_quark_plugin.py @@ -66,4 +66,20 @@ class TestSubnets(TestQuarkPlugin): class TestIpAddresses(TestQuarkPlugin): - pass + def test_create_ip_address_success(self): + pass + + def test_create_ip_success_failure(self): + pass + + def test_get_ip_address_success(self): + pass + + def test_get_ip_address_failure(self): + pass + + def test_get_ip_addresses_success(self): + pass + + def test_update_ip_address_success(self): + pass
Added skeleton for tests on IpAddress and methods on QuarkPlugin.
openstack_quark
train
py,py
a9d4806cb1ccbb95fbfbdca3cfd6491a812ec0da
diff --git a/base.php b/base.php index <HASH>..<HASH> 100644 --- a/base.php +++ b/base.php @@ -524,7 +524,7 @@ final class Base extends Prefab implements ArrayAccess { **/ function push($key,$val) { $ref=&$this->ref($key); - array_push($ref,$val); + $ref[] = $val; return $val; }
One liner. Use [], instead of array_push() in Base::push(). Its faster, minor convenience to user.
bcosca_fatfree-core
train
php
d510b9c912734b4cee1afefbea332747af4ca22e
diff --git a/views/js/layout/actions/common.js b/views/js/layout/actions/common.js index <HASH>..<HASH> 100644 --- a/views/js/layout/actions/common.js +++ b/views/js/layout/actions/common.js @@ -377,7 +377,12 @@ define([ .then(function(response) { var message; var i; - if (response && response.status === 'diff') { + + if (response && response.status === true) { + return + } + + else if (response && response.status === 'diff') { message = __("Moving this element will replace the properties of the previous class by those of the destination class :"); message += "\n"; for (i = 0; i < response.data.length; i++) { @@ -392,12 +397,6 @@ define([ data.confirmed = true; return _moveNode(url, data); } - } else if (response && response.status === true) { - //open the destination branch - $(actionContext.tree).trigger('openbranch.taotree', [{ - id : actionContext.destinationClassUri - }]); - return; } //ask to rollback the tree
fix: Remove unnecessary openbranch event trigger
oat-sa_tao-core
train
js
be55bb812b0d9421f17f2b3e9c51a9ede4197377
diff --git a/pmag_basic_dialogs.py b/pmag_basic_dialogs.py index <HASH>..<HASH> 100755 --- a/pmag_basic_dialogs.py +++ b/pmag_basic_dialogs.py @@ -2669,7 +2669,9 @@ class check(wx.Frame): col_labels[:0] = ['er_site_name', 'er_citation_names', 'er_location_name'] except: pass - self.age_grid = self.make_simple_table(col_labels, self.ErMagic.data_er_ages, "age") + # only use sites that are associated with actual samples/specimens + ages_data_dict = {k: v for k, v in self.ErMagic.data_er_ages.items() if k in self.sites} + self.age_grid = self.make_simple_table(col_labels, ages_data_dict, "age") # # make it impossible to edit the 1st 3 columns for row in range(self.age_grid.GetNumberRows()):
QuickMagic step3: fix check ages to display only sites that are actually part of the updated data
PmagPy_PmagPy
train
py
2fda7d61a124da109e0ed235d739fc1fb4028dd9
diff --git a/examples/basic.js b/examples/basic.js index <HASH>..<HASH> 100644 --- a/examples/basic.js +++ b/examples/basic.js @@ -1,7 +1,7 @@ /** - * Basic example of connecting to the Structure platform. + * Basic example of connecting to the Losant platform. * - * Copyright (c) 2016 Structure. All rights reserved. + * Copyright (c) 2016 Losant. All rights reserved. * http://www.losant.com */ @@ -14,7 +14,7 @@ var device = new Device({ secret: 'my-access-secret' }); -// Connect device to Structure. +// Connect device to Losant. device.connect(); @@ -24,10 +24,10 @@ device.on('command', function(command) { console.log(command.payload); }); -// Once a second, report state to Structure. +// Once a second, report state to Losant. setInterval(function() { - // Report state to Structure. + // Report state to Losant. if(device.isConnected()) { device.sendState({ key: 'value' }); }
fix a few more old structure references
Losant_losant-mqtt-js
train
js
eef1f09d770d566fc33ddb0901995c830af39ffa
diff --git a/java/src/com/google/template/soy/error/SoyErrorKind.java b/java/src/com/google/template/soy/error/SoyErrorKind.java index <HASH>..<HASH> 100644 --- a/java/src/com/google/template/soy/error/SoyErrorKind.java +++ b/java/src/com/google/template/soy/error/SoyErrorKind.java @@ -16,6 +16,7 @@ package com.google.template.soy.error; + import com.google.common.base.Preconditions; import java.text.MessageFormat;
EditDistance callers will now call to common/editdistance instead of common/string * The new classes in common/distance are equivalent but not identical * The edit distance classes in common/string will be deprecated and removed Tested: [] presubmits for global presubmit queue [] Some tests failed; test failures are believed to be unrelated to this CL ------------- Created by MOE: <URL>
google_closure-templates
train
java
29bf10df8f95222b028fb42a7a354578f217185c
diff --git a/src/FreeDSx/Asn1/Encoder/EncoderInterface.php b/src/FreeDSx/Asn1/Encoder/EncoderInterface.php index <HASH>..<HASH> 100644 --- a/src/FreeDSx/Asn1/Encoder/EncoderInterface.php +++ b/src/FreeDSx/Asn1/Encoder/EncoderInterface.php @@ -11,6 +11,7 @@ namespace FreeDSx\Asn1\Encoder; use FreeDSx\Asn1\Exception\EncoderException; +use FreeDSx\Asn1\Exception\PartialPduException; use FreeDSx\Asn1\Type\AbstractType; use FreeDSx\Asn1\Type\IncompleteType; @@ -48,6 +49,7 @@ interface EncoderInterface * @param array $tagMap * @return AbstractType * @throws EncoderException + * @throws PartialPduException */ public function decode($binary, array $tagMap = []) : AbstractType; }
Add a missing throws statement in phpdoc.
FreeDSx_ASN1
train
php
dd033ab0cbe8fa94821bc9a552f8db18eeb4e4fd
diff --git a/lib/carrierwave/mongoid/version.rb b/lib/carrierwave/mongoid/version.rb index <HASH>..<HASH> 100644 --- a/lib/carrierwave/mongoid/version.rb +++ b/lib/carrierwave/mongoid/version.rb @@ -1,5 +1,5 @@ module Carrierwave module Mongoid - VERSION = "0.1.6" + VERSION = "0.1.7" end end
Bumped version to <I>
carrierwaveuploader_carrierwave-mongoid
train
rb
6c85504275b26d351347157387dd192db2d16715
diff --git a/grimoire/ocean/elastic.py b/grimoire/ocean/elastic.py index <HASH>..<HASH> 100644 --- a/grimoire/ocean/elastic.py +++ b/grimoire/ocean/elastic.py @@ -207,7 +207,8 @@ class ElasticOcean(object): url = self.elastic.index_url # 1 minute to process the results of size items # In gerrit enrich with 500 items per page we need >1 min - max_process_items_pack_time = "3m" # 3 minutes + # In Mozilla ES in Amazon we need 10m + max_process_items_pack_time = "10m" # 10 minutes url += "/_search?scroll=%s&size=%i" % (max_process_items_pack_time, self.elastic_page)
[ocean] Increase scroll results persistence to <I>m so Mozilla env works
chaoss_grimoirelab-elk
train
py
a8f3ff9dc5f99c821d01678ef0af944377ee081b
diff --git a/bika/lims/content/abstractanalysis.py b/bika/lims/content/abstractanalysis.py index <HASH>..<HASH> 100644 --- a/bika/lims/content/abstractanalysis.py +++ b/bika/lims/content/abstractanalysis.py @@ -195,6 +195,8 @@ class AbstractAnalysis(AbstractBaseAnalysis): @security.public def getLastVerificator(self): + if not self.getVerificators(): + return None return self.getVerificators().split(',')[-1] @security.public
Return None if there is no 'verificator'.
senaite_senaite.core
train
py
bf570b6a3e1a37138d85b71939d3a6467a9f2982
diff --git a/tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerConfiguration.java b/tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerConfiguration.java index <HASH>..<HASH> 100644 --- a/tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerConfiguration.java +++ b/tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerConfiguration.java @@ -63,7 +63,8 @@ public class JaegerConfiguration implements Toggleable { */ public JaegerConfiguration( ApplicationConfiguration applicationConfiguration) { - if (StringUtils.isEmpty(System.getProperty(JAEGER_SERVICE_NAME))) { + if (StringUtils.isEmpty(System.getProperty(JAEGER_SERVICE_NAME)) + && StringUtils.isEmpty(System.getenv(JAEGER_SERVICE_NAME))) { System.setProperty(JAEGER_SERVICE_NAME, applicationConfiguration.getName().orElse(Environment.DEFAULT_NAME)); } configuration = Configuration.fromEnv();
setting JAEGER_SERVICE_NAME system prop if not present in system prop or env (#<I>)
micronaut-projects_micronaut-core
train
java
b28f444d8a8769a62420f415f9f318e0b43e6707
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( author_email='aka.tkf@gmail.com', url='https://github.com/tkf/python-epc', license=epc.__license__, - description='EPC (RPC stack for Emacs Lisp) server for Python', + description='EPC (RPC stack for Emacs Lisp) implementation in Python', long_description=epc.__doc__, keywords='Emacs, RPC', classifiers=[
Fix package description: it supports client now
tkf_python-epc
train
py
cc18a85591b46aea2ca4daf268862a5641c50dbd
diff --git a/src/navigator.js b/src/navigator.js index <HASH>..<HASH> 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -282,7 +282,7 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* bottomright; viewerSize = $.getElementSize( this.viewer.element ); - if ( this._resizeWithViewer && !viewerSize.equals( this.oldViewerSize ) ) { + if ( this._resizeWithViewer && viewerSize.x && viewerSize.y && !viewerSize.equals( this.oldViewerSize ) ) { this.oldViewerSize = viewerSize; if ( this.maintainSizeRatio || !this.elementArea) {
when reloading, viewerSize is being set to 0, 0. check that x and y have a non-zero value, otherwise results in IE8 error when rounding NaN
openseadragon_openseadragon
train
js
d6f2288ec8f3419568fadfbaf5feaae73c83fc91
diff --git a/visidata/windows.py b/visidata/windows.py index <HASH>..<HASH> 100644 --- a/visidata/windows.py +++ b/visidata/windows.py @@ -24,3 +24,8 @@ if vd.is_windows: # Alt+F1 instead of Alt+1 for i in range(12): vd.bindkey('KEY_F(%s)'%(i+37), ALT+'%s'%(i+1)) + + vd.options.color_key_col = 'cyan' + vd.options.color_note_type = 'yellow' + vd.options.color_note_row = 'yellow' + vd.options.color_selected_row = 'yellow'
[windows] make some default colors look better
saulpw_visidata
train
py
b4e0c7ee4b89279843740bc89900b06848524f73
diff --git a/lib/connection.js b/lib/connection.js index <HASH>..<HASH> 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -9,9 +9,10 @@ class Connection { constructor(options) { this.options = options + this.connected = false + this.subscriptions = [] this.queue = new Queue(options) this.auth = new Auth(options) - this.subscriptions = [] } @@ -26,9 +27,24 @@ class Connection { // Connect to parent namespace this.client = io.connect(this.options.api_url + this.options.namespace, sioConfig) this.client.on("connect_error", (err) => { + this.connected = false this.reconnect() }) + // No ready event after connect? Something went wrong, so reconnect + this.client.on("connect", () => { + console.log(this.connected) + this.client.on("ready", () => this.connected = true) + + setTimeout(() => { + console.log(this.connected) + if(!this.connected) { + console.log("still not connected") + this.reconnect() + } + }, 1000) + }) + // Resubscribe after disconnect this.resub() @@ -75,6 +91,7 @@ class Connection { this.http = request.defaults(httpConfig) this.client.once("connect", () => { + this.client.once("ready", () => this.connected = true) resolve() }) })
Added timer based reconnect. Included connection state
cubic-js_cubic
train
js
7447eac5ef1c7175e1734e507c132fae9e38515e
diff --git a/src/s9e/TextFormatter/Plugins/MarkdownLite/Parser.php b/src/s9e/TextFormatter/Plugins/MarkdownLite/Parser.php index <HASH>..<HASH> 100644 --- a/src/s9e/TextFormatter/Plugins/MarkdownLite/Parser.php +++ b/src/s9e/TextFormatter/Plugins/MarkdownLite/Parser.php @@ -48,15 +48,26 @@ class Parser extends ParserBase if (!$spn) { + // NOTE: might be the continuation of a quote :\ continue; } + preg_match_all( + '/> ?|\\* *\\* *\\*[* ]*$|- *- *-[- ]*$|[-*+] |\\d\\. |#+$/S', + substr($line, 0, $spn), + $matches + ); + // Blockquote: ">" or "> " - // List item: "* " preceded by any number of spaces - // List item: "- " preceded by any number of spaces - // List item: "+ " preceded by any number of spaces + // List item: "* " + // List item: "- " + // List item: "+ " // List item: at least one digit followed by ". " - // HR: "* * *" or "- - -" or "***" or "---" + // HR: At least three * or - alone on a line, with any number of spaces between + // Headings: #+ alone on a line + // Headings: possibly any number of - or = alone on a line + // + // NOTE: apparently the only elements allowed after a list item are more list items } // Inline code
MarkdownLite: saved notes [ci skip]
s9e_TextFormatter
train
php
3cb94e1589e1ae27a184725b1719aa971ed5fb1c
diff --git a/backtrader/cerebro.py b/backtrader/cerebro.py index <HASH>..<HASH> 100644 --- a/backtrader/cerebro.py +++ b/backtrader/cerebro.py @@ -695,12 +695,12 @@ class Cerebro(with_metaclass(MetaParams, object)): if sizer is not None: strat._addsizer(sizer, *sargs, **skwargs) + strat._start() + for writer in self.runwriters: if writer.p.csv: writer.addheaders(strat.getwriterheaders()) - strat._start() - for strat in runstrats: strat.qbuffer(self._exactbars)
start strategy after fetching csv headers to give time to analyzers if needed
backtrader_backtrader
train
py
01e301094293441cb1e9fc4aed34b02d38f28701
diff --git a/slick.editors.js b/slick.editors.js index <HASH>..<HASH> 100644 --- a/slick.editors.js +++ b/slick.editors.js @@ -295,7 +295,7 @@ var PercentCompleteCellEditor = function($container, columnDef, value, dataConte $input.val(defaultValue); } - $input.width(columnDef.width - 20); + $input.width($container.innerWidth() - 20); $input.appendTo($container); $picker = $("<div class='editor-percentcomplete-picker' />").appendTo($container);
Fixed a layout issue in the graphical percent complete editor.
coatue-oss_slickgrid2
train
js
1b239797369914fdac3539e093b0c4b96aaa9605
diff --git a/src/transformers/models/vilt/configuration_vilt.py b/src/transformers/models/vilt/configuration_vilt.py index <HASH>..<HASH> 100644 --- a/src/transformers/models/vilt/configuration_vilt.py +++ b/src/transformers/models/vilt/configuration_vilt.py @@ -21,7 +21,7 @@ from ...utils import logging logger = logging.get_logger(__name__) VILT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - # TODO + "dandelin/vilt-b32-mlm": "https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json" } @@ -30,7 +30,7 @@ class ViltConfig(PretrainedConfig): This is the configuration class to store the configuration of a [`ViLTModel`]. It is used to instantiate an ViLT model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the ViLT - [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) architecture. + [dandelin/vilt-b32-mlm](https://huggingface.co/dandelin/vilt-b32-mlm) architecture. Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PretrainedConfig`] for more information.
[ViLT] Fix checkpoint url in config (#<I>) * [ViLT] Fix checkpoint url in config * Apply suggestions from code review
huggingface_pytorch-pretrained-BERT
train
py
73849b4f08f7900642bf74975b923e4263916014
diff --git a/tests/test_30_mdstore.py b/tests/test_30_mdstore.py index <HASH>..<HASH> 100644 --- a/tests/test_30_mdstore.py +++ b/tests/test_30_mdstore.py @@ -464,7 +464,6 @@ def test_metadata_extension_algsupport(): mds = MetadataStore(list(ONTS.values()), ATTRCONV, None) mds.imp(METADATACONF["12"]) mdf = mds.metadata[full_path("uu.xml")] - _txt = mdf.dumps() assert mds if __name__ == "__main__":
In between just so Hans can get his stuff in.
IdentityPython_pysaml2
train
py
1e967f22541adba4ac388648756cfd70c39110f4
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -51,7 +51,9 @@ if (ci && ci !== 'gitlab') { } }) } else if (process.env.CI && process.env.GITLAB_CI) { - t.is(ci, 'gitlab') + test('ci is correctly set', t => { + t.is(ci, 'gitlab') + }) } else { console.log('These tests can only run in CI environments') test(t => t.pass())
correcting test for gitlab CI
siddharthkp_ci-env
train
js
bb774515ceef837489037e831476578cea8a2ae7
diff --git a/pybotvac/account.py b/pybotvac/account.py index <HASH>..<HASH> 100644 --- a/pybotvac/account.py +++ b/pybotvac/account.py @@ -102,11 +102,12 @@ class Account: resp.raise_for_status() for robot in resp.json()['robots']: - self._robots.add(Robot(name=robot['name'], - serial=robot['serial'], - secret=robot['secret_key'], - traits=robot['traits'], - endpoint=robot['nucleo_url'])) + if robot['mac_address'] != None: + self._robots.add(Robot(name=robot['name'], + serial=robot['serial'], + secret=robot['secret_key'], + traits=robot['traits'], + endpoint=robot['nucleo_url'])) @staticmethod def get_map_image(url, dest_path=None):
Ignore robots that are not connected neato robots
stianaske_pybotvac
train
py
d4488ca78096fa3af3b8c97bf4ed8074d9d773ae
diff --git a/azure-storage-blob/src/Blob/BlobRestProxy.php b/azure-storage-blob/src/Blob/BlobRestProxy.php index <HASH>..<HASH> 100644 --- a/azure-storage-blob/src/Blob/BlobRestProxy.php +++ b/azure-storage-blob/src/Blob/BlobRestProxy.php @@ -379,8 +379,15 @@ class BlobRestProxy extends ServiceRestProxy implements IBlob private function getBlobUrl($container, $blob) { $encodedBlob = $this->createPath($container, $blob); + $uri = $this->getPsrPrimaryUri(); + $exPath = $uri->getPath(); - return (string)($this->getPsrPrimaryUri()->withPath($encodedBlob)); + if ($exPath != '') { + //Remove the duplicated slash in the path. + $encodedBlob = str_replace('//', '/', $exPath . $encodedBlob); + } + + return (string) $uri->withPath($encodedBlob); } /**
keep primary uri path when it exists (#<I>) * keep primary uri path when it exists * generalize duplicated slash removal
Azure_azure-storage-php
train
php
259349f08eb1ebb27d300dcddc46134bd642e28e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -161,7 +161,7 @@ module.exports = function specReporter(logger) { return function(stream, report) var colour = failed? failure : success log('') - log( colour('Ran ' + total + ' tests') + ' ' + log( colour('Ran ' + total + ' ' + plural(total, 'test')) + ' ' + faded('(' + renderIgnored(ignored) + data.time() + 'ms)')) if (passed) log(success(passed + ' ' + plural(passed, 'test') + ' passed.')) if (failed) log(failure(failed + ' ' + plural(failed, 'test') + ' failed.'))
Fixes pluralization on 'Ran X tests' (Closes #3)
robotlolita_specify-reporter-spec
train
js
d3202e43d034edacc02df90f5c600e4d7ed0fed0
diff --git a/db/db.py b/db/db.py index <HASH>..<HASH> 100644 --- a/db/db.py +++ b/db/db.py @@ -140,15 +140,15 @@ class Column(object): >>> from db import DemoDB >>> db = DemoDB() >>> db.tables.Customer.City.head() - 0 São José dos Campos + 0 Sao Jose dos Campos 1 Stuttgart - 2 Montréal + 2 Montreal 3 Oslo 4 Prague 5 Prague Name: City, dtype: object >>> db.tables.Customer.City.head(2) - 0 São José dos Campos + 0 Sao Jose dos Campos 1 Stuttgart Name: City, dtype: object """ @@ -196,10 +196,10 @@ class Column(object): >>> from db import DemoDB >>> db = DemoDB() >>> db.tables.Customer.FirstName.unique().head(10) - 0 Luís + 0 Luis 1 Leonie - 2 François - 3 Bjørn + 2 Francois + 3 Bjorn 4 Franti\u0161ek 5 Helena 6 Astrid @@ -234,7 +234,7 @@ class Column(object): from db import DemoDB db = DemoDB() db.tables.Artist.Name.sample(10) - 0 Pedro Luís & A Parede + 0 Pedro Luis & A Parede 1 Santana Feat. Eric Clapton 2 Os Mutantes 3 Banda Black Rio
removing non-ascii stuff just b/c python really annoys me
yhat_db.py
train
py
94c402c3a4099f688c6a92247442d7bd0cdb705f
diff --git a/src/CountryPicker.js b/src/CountryPicker.js index <HASH>..<HASH> 100644 --- a/src/CountryPicker.js +++ b/src/CountryPicker.js @@ -75,7 +75,7 @@ export default class CountryPicker extends Component { // to provide a functionality to disable/enable the onPress of Country Picker. disabled: PropTypes.bool, filterPlaceholderTextColor: PropTypes.string, - closeButtonImage: PropTypes.element, + closeButtonImage: PropTypes.oneOfType([PropTypes.number, PropTypes.object]), transparent: PropTypes.bool, animationType: PropTypes.oneOf(['slide', 'fade', 'none']), flagType: PropTypes.oneOf(Object.values(FLAG_TYPES)),
Update prop type for closeButtonImage to fix #<I> (#<I>) Set propTypes.closeButtonImage in CountryPicker.js to the React Native ImageSource prop type (either number or {uri: ...} object)
xcarpentier_react-native-country-picker-modal
train
js
9cbc452dc0f5304262b3ac2c7f03441e2715c31e
diff --git a/src/main/java/io/github/bonigarcia/wdm/config/Architecture.java b/src/main/java/io/github/bonigarcia/wdm/config/Architecture.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/wdm/config/Architecture.java +++ b/src/main/java/io/github/bonigarcia/wdm/config/Architecture.java @@ -45,8 +45,8 @@ public enum Architecture { return this.archLabels.stream(); } - public boolean matchString(String string) { - return archLabelsStream().anyMatch(x -> string.contains(x)); + public boolean matchString(String strMatch) { + return archLabelsStream().anyMatch(strMatch::contains); } public boolean matchUrl(URL url) {
Smell-fix in method for matchin architecture
bonigarcia_webdrivermanager
train
java
09e1b729f8171587217e1b7613d326aee03a1d57
diff --git a/src/EmailAddress.php b/src/EmailAddress.php index <HASH>..<HASH> 100644 --- a/src/EmailAddress.php +++ b/src/EmailAddress.php @@ -106,7 +106,7 @@ class EmailAddress implements EmailAddressInterface * @throws \InvalidArgumentException If the $username parameter is not a string. * @throws EmailAddressInvalidArgumentException If the $username parameter is not a valid username. * - * @return EmailAddress The email address. + * @return EmailAddressInterface The email address. */ public static function fromParts($username, HostInterface $host) {
Change return type in fromParts method in EmailAddress
themichaelhall_datatypes
train
php
67ad2c9722d68592c4cc5b9437832763e66ffa30
diff --git a/pysparkling/sql/internals.py b/pysparkling/sql/internals.py index <HASH>..<HASH> 100644 --- a/pysparkling/sql/internals.py +++ b/pysparkling/sql/internals.py @@ -340,9 +340,8 @@ class DataFrameInternal(object): cols = [parse(e) for e in exprs] if any(col.is_an_aggregation for col in cols): - raise NotImplementedError - # df_as_group = InternalGroupedDataFrame(self, []) - # return df_as_group.agg(exprs) + df_as_group = InternalGroupedDataFrame(self, []) + return df_as_group.agg(exprs) def select_mapper(partition_index, partition): # Initialize non deterministic functions so that they are reproducible
Add support of aggregations in DataFrame.select
svenkreiss_pysparkling
train
py
a7fc5701584bc28cd34fc3f018cc107616f7cd9a
diff --git a/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java b/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java +++ b/core/src/main/java/hudson/util/io/RewindableFileOutputStream.java @@ -29,6 +29,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.StandardOpenOption; import org.apache.commons.io.FileUtils; @@ -54,7 +55,7 @@ public class RewindableFileOutputStream extends OutputStream { FileUtils.forceMkdir(out.getParentFile()); try { current = Files.newOutputStream(out.toPath(), StandardOpenOption.TRUNCATE_EXISTING); - } catch (FileNotFoundException e) { + } catch (FileNotFoundException | NoSuchFileException e) { throw new IOException("Failed to open "+out,e); } }
[JENKINS-<I>] Need to catch a different exception
jenkinsci_jenkins
train
java
ad747c872ab8cf8235e036a023addddf0d629bf5
diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php index <HASH>..<HASH> 100644 --- a/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/LazyLoadingValueHolderFunctionalTest.php @@ -223,14 +223,13 @@ class LazyLoadingValueHolderFunctionalTest extends PHPUnit_Framework_TestCase { $proxyClass = $this->generateProxy('ProxyManagerTestAsset\\BaseClass'); $counter = 0; - $initializer = function (& $wrappedInstance) use (& $counter) { + + /* @var $proxy BaseClass */ + $proxy = $proxyClass::staticProxyConstructor(function (& $wrappedInstance) use (& $counter) { $wrappedInstance = new BaseClass(); $wrappedInstance->publicProperty = (string) ($counter += 1); - }; - - /* @var $proxy BaseClass */ - $proxy = $proxyClass::staticProxyConstructor($initializer); + }); $this->assertSame('1', $proxy->publicProperty); $this->assertSame('2', $proxy->publicProperty);
Simplified test code (avoiding unused assignment)
Ocramius_ProxyManager
train
php
9c1f6a2407b8ca5bcf17755505690ebe6052296c
diff --git a/media/boom-assets/js/boom.assets.js b/media/boom-assets/js/boom.assets.js index <HASH>..<HASH> 100755 --- a/media/boom-assets/js/boom.assets.js +++ b/media/boom-assets/js/boom.assets.js @@ -494,6 +494,8 @@ $.widget( 'boom.browser_asset', $.boom.browser, $('#b-items-view-list input[type=checkbox]').each(function() { $(this).prop('checked', checked); }) + + $('.b-items-select-checkbox').change(); }); $.when( self.browse() )
Bugfix: enable multi action buttons after selecting all assets
boomcms_boom-core
train
js
d33640dce41a72c4c770cf62f6586662fe7785a7
diff --git a/pywws/Plot.py b/pywws/Plot.py index <HASH>..<HASH> 100755 --- a/pywws/Plot.py +++ b/pywws/Plot.py @@ -264,12 +264,12 @@ set timefmt "%Y-%m-%dT%H:%M:%S" elif source == self.hourly_data: boxwidth = 2800 start = source.before(start) - interval = timedelta(minutes=61) + interval = timedelta(minutes=90) elif source == self.monthly_data: boxwidth = 2800 * 24 * 30 - interval = timedelta(days=32) + interval = timedelta(days=46) else: - interval = timedelta(hours=25) + interval = timedelta(hours=36) boxwidth = 2800 * 24 boxwidth = eval(self.GetValue(plot, 'boxwidth', str(boxwidth))) result += 'set boxwidth %d\n' % boxwidth @@ -308,7 +308,7 @@ set timefmt "%Y-%m-%dT%H:%M:%S" idx += self.utcoffset if not subplot.cummulative and subplot.last_idx: if source == self.raw_data: - interval = timedelta(minutes=1+data['delay']) + interval = timedelta(minutes=((data['delay']*3)+1)/2) if idx - subplot.last_idx > interval: # missing data subplot.dat.write('%s ?\n' % (idx.isoformat()))
Extended the time between readings Plot.py allows before putting a gap in the plotted line.
jim-easterbrook_pywws
train
py
46d828bf048f1f2989c4a44f8dc46a249be05444
diff --git a/src/Controller/RankingController.php b/src/Controller/RankingController.php index <HASH>..<HASH> 100644 --- a/src/Controller/RankingController.php +++ b/src/Controller/RankingController.php @@ -63,14 +63,20 @@ class RankingController extends ControllerBase { public static function getTableFromRanking($rankingDays) { + $user = \Drupal::currentUser(); $rows = []; - foreach ($rankingDays as $ranking) {; + foreach ($rankingDays as $ranking) { $row = [ - 'position' => $ranking->get('position')->value, - 'better' => $ranking->getOwner()->getUsername(), - 'points' => $ranking->get('points')->value, - 'games_betted' => $ranking->get('games_betted')->value, + 'data' => [ + 'position' => $ranking->get('position')->value, + 'better' => $ranking->getOwner()->getUsername(), + 'points' => $ranking->get('points')->value, + 'games_betted' => $ranking->get('games_betted')->value, + ] ]; + if($ranking->getOwner()->id() == $user->id()) { + $row['class'] = ['highlighted','bold']; + } $rows[] = $row; } $header = [
Ranking - add class on user row
mespronos_mespronos
train
php
979376b9c281c89789a26018427958a2ee5bfd41
diff --git a/src/picturefill.js b/src/picturefill.js index <HASH>..<HASH> 100644 --- a/src/picturefill.js +++ b/src/picturefill.js @@ -659,11 +659,12 @@ }, 250 ); var resizeTimer; + var handleResize = function() { + picturefill({ reevaluate: true }); + }; function checkResize() { clearTimeout(resizeTimer); - resizeTimer = setTimeout( function() { - picturefill({ reevaluate: true }); - }, 60 ); + resizeTimer = setTimeout( handleResize, 60 ); } if ( w.addEventListener ) {
dont define debounced function every time user resizes
scottjehl_picturefill
train
js
ef7d9bd1c01a94d0fb92332c959ecc7792142c68
diff --git a/epc/client.py b/epc/client.py index <HASH>..<HASH> 100644 --- a/epc/client.py +++ b/epc/client.py @@ -32,6 +32,8 @@ class EPCClientHandler(EPCHandler): class EPCClient(EPCCore): + thread_daemon = True + def __init__(self, socket_or_address=None, debugger=None): if socket_or_address is not None: self.connect(socket_or_address) @@ -52,6 +54,7 @@ class EPCClient(EPCCore): self.methods = self.handler.methods self.handler_thread = threading.Thread(target=self.handler.start) + self.handler_thread.daemon = self.thread_daemon self.handler_thread.start() self.handler.wait_until_ready()
Make thread for EPCClient daemon by default
tkf_python-epc
train
py
3b594afc2897073db2659362e14ec67c06fac933
diff --git a/hsreplay/__init__.py b/hsreplay/__init__.py index <HASH>..<HASH> 100644 --- a/hsreplay/__init__.py +++ b/hsreplay/__init__.py @@ -9,7 +9,7 @@ from xml.dom import minidom __author__ = "Jerome Leclanche" __email__ = "jerome@leclan.ch" -__version__ = "1.0" +__version__ = "1.1" SYSTEM_DTD = "http://hearthsim.info/hsreplay/dtd/hsreplay-%s.dtd" % (__version__)
Update DTD version to <I>
HearthSim_python-hsreplay
train
py
02d2b8804c2e03e4b4e0e0996db4af2051daec53
diff --git a/packages/blueprint/lib/middleware/render.js b/packages/blueprint/lib/middleware/render.js index <HASH>..<HASH> 100644 --- a/packages/blueprint/lib/middleware/render.js +++ b/packages/blueprint/lib/middleware/render.js @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2018 One Hill Technologies, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { fromCallback } = require ('bluebird'); + /** * Factory method that generates a middleware function for rendering a static * view to a request. @@ -7,7 +25,9 @@ */ module.exports = function render (view) { return function __blueprint_render (req, res, next) { - res.render (view); - next (); + return fromCallback (callback => res.render (view, callback)) + .then (html => res.status (200).send (html)) + .then (() => next ()) + .catch (next); }; };
The render middleware threw an exception
onehilltech_blueprint
train
js
ba3e818e6186c8c02bb9d2ab3ef76851f3195263
diff --git a/src/mongo/delegates/Tables.class.php b/src/mongo/delegates/Tables.class.php index <HASH>..<HASH> 100644 --- a/src/mongo/delegates/Tables.class.php +++ b/src/mongo/delegates/Tables.class.php @@ -392,7 +392,7 @@ class Tables extends CompositeBase foreach ($rt["rdf:type"] as $type) { // Defensive check in case there is bad data for rdf:type - if(array_key_exists('u', $type['rdf:type'])) + if(array_key_exists('u', $type)) { $this->generateTableRowsForType($type['u'],$id[_ID_RESOURCE],$id[_ID_CONTEXT], $specTypes); }
Defensive check got a little wonky there
talis_tripod-php
train
php
e5bdb2bbbaa26cd864c6b1d1e571718dae2fbda7
diff --git a/headers/runtests.py b/headers/runtests.py index <HASH>..<HASH> 100755 --- a/headers/runtests.py +++ b/headers/runtests.py @@ -109,6 +109,9 @@ def _RunCommand(args): def GetAndPrintOutput(fp): output = fp.read() + if not isinstance(output, str): + # This should only happen in Python 3.0, where str is unicode str. + output = str(output, 'ascii') fp.close() if output: print(output)
Another py3k-ism. Bytes are returned from subprocess, need to make it a str. git-svn-id: <URL>
myint_cppclean
train
py
c574c2f8274b378d267d1c8d9430cfa9977fa47d
diff --git a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextAreaExample.java b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextAreaExample.java index <HASH>..<HASH> 100755 --- a/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextAreaExample.java +++ b/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextAreaExample.java @@ -116,9 +116,9 @@ public class TextAreaExample extends WPanel { add(toggleDisableButton); add(new WHorizontalRule()); - layout = new WFieldLayout(); heading = new WHeading(HeadingLevel.H2, "Rich Text"); add(heading); + layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED); add(layout); ta5 = new WTextArea();
Clean up example Just made a minor change to the WTextArea example to make rich text a bit nicer to use.
BorderTech_wcomponents
train
java
e1abb20200b624a9f75f3aa24843ccc29e0c3b25
diff --git a/fr/validation.php b/fr/validation.php index <HASH>..<HASH> 100644 --- a/fr/validation.php +++ b/fr/validation.php @@ -101,6 +101,7 @@ return array( "first_name" => "Prénom", "last_name" => "Nom", "password" => "Mot de passe", + "password_confirmation" => "Confirmation du mot de passe", "city" => "Ville", "country" => "Pays", "address" => "Adresse",
Add password_confirmation to fr Add password_confirmation validation's attribute to the french language
caouecs_Laravel-lang
train
php
04533960fc617ad1c56ae85526aee4c4c614c6ff
diff --git a/interp/interp_test.go b/interp/interp_test.go index <HASH>..<HASH> 100644 --- a/interp/interp_test.go +++ b/interp/interp_test.go @@ -30,7 +30,7 @@ import ( // The timeout saves us from hangs or burning too much CPU if there are bugs. // All the test cases are designed to be inexpensive and stop in a very short // amount of time, so 5s should be plenty even for busy machines. -const runnerRunTimeout = 1 * time.Second +const runnerRunTimeout = 5 * time.Second // Some program which should be in $PATH. Needs to run before runTests is // initialized (so an init function wouldn't work), because runTest uses it.
interp: increase the test timeouts again The last commit lowered it back to 1s, while I was locally debugging. I of course forgot to revert that. Maybe next time I need to add a loud TODO or FIXME to remind myself before I commit and push.
mvdan_sh
train
go
aadc9914ff34edaf564b67706852f34c17245fb4
diff --git a/core/src/main/java/hudson/model/LoadStatistics.java b/core/src/main/java/hudson/model/LoadStatistics.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/LoadStatistics.java +++ b/core/src/main/java/hudson/model/LoadStatistics.java @@ -51,6 +51,7 @@ import java.io.Serializable; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.List; +import javax.annotation.CheckForNull; /** * Utilization statistics for a node or a set of nodes. @@ -614,13 +615,17 @@ public abstract class LoadStatistics { return this; } - public Builder with(Node node) { - if (node != null) - return with(node.toComputer()); + public Builder with(@CheckForNull Node node) { + if (node != null) { + return with(node.toComputer()); + } return this; } - public Builder with(Computer computer) { + public Builder with(@CheckForNull Computer computer) { + if (computer == null) { + return this; + } if (computer.isOnline()) { final List<Executor> executors = computer.getExecutors(); final boolean acceptingTasks = computer.isAcceptingTasks();
[FIXED JENKINS-<I>] NPE when Node.toComputer → null. (cherry picked from commit <I>bac<I>fcbc6f<I>fa0db<I>e<I>d<I>d7)
jenkinsci_jenkins
train
java
c060086f69575172502e79d4c1ff340b587167d3
diff --git a/scoper.php b/scoper.php index <HASH>..<HASH> 100644 --- a/scoper.php +++ b/scoper.php @@ -84,6 +84,18 @@ return [ return $content; }, + // fixes https://github.com/rectorphp/rector/issues/6010 + function (string $filePath, string $prefix, string $content): string { + // @see https://regex101.com/r/bA1nQa/1 + if (! Strings::match($filePath, '#vendor/symfony/polyfill-php\d{2}/Resources/stubs#')) { + return $content; + } + + // @see https://regex101.com/r/x5Ukrx/1 + $namespace = sprintf('#namespace %s;#m', $prefix); + return Strings::replace($content, $namespace); + }, + // unprefix string classes, as they're string on purpose - they have to be checked in original form, not prefixed function (string $filePath, string $prefix, string $content): string { // skip vendor, expect rector packages
[Scoper] Fixes #<I> Remove namespaced on polyfill symfony Stubs (#<I>)
rectorphp_rector
train
php
4374ee4e77f16a1910c45b1f0754df19a1fcafef
diff --git a/src/Serve/ServeConvertedWebP.php b/src/Serve/ServeConvertedWebP.php index <HASH>..<HASH> 100644 --- a/src/Serve/ServeConvertedWebP.php +++ b/src/Serve/ServeConvertedWebP.php @@ -65,7 +65,7 @@ class ServeConvertedWebP } } - private static function serveDestination($destination, $options) + public static function serveDestination($destination, $options) { ServeFile::serve($destination, 'image/webp', $options); }
ok, serveDestination can be public
rosell-dk_webp-convert
train
php
b41f8d46efd482208e9004e2bb93e488f8b69107
diff --git a/go/libkb/id_table.go b/go/libkb/id_table.go index <HASH>..<HASH> 100644 --- a/go/libkb/id_table.go +++ b/go/libkb/id_table.go @@ -993,7 +993,8 @@ func (s *WalletStellarChainLink) Display(m MetaContext, ui IdentifyUI) error { // First get an up to date user card, since hiding the Stellar address affects it. card, err := UserCard(m, s.GetUID(), true) if err != nil { - return fmt.Errorf("Error getting usercard: %s", err) + m.Info("Could not get usercard, so skipping displaying stellar chain link: %s.", err) + return nil } selfUID := m.G().Env.GetUID() if selfUID.IsNil() {
do not hard fail if there is no session to check for wallet address (#<I>)
keybase_client
train
go
58dd2923dff83b65f7d66f9d9a0b5f658012b724
diff --git a/platforms/mqtt/mqtt_adaptor.go b/platforms/mqtt/mqtt_adaptor.go index <HASH>..<HASH> 100644 --- a/platforms/mqtt/mqtt_adaptor.go +++ b/platforms/mqtt/mqtt_adaptor.go @@ -5,10 +5,10 @@ import ( "github.com/hybridgroup/gobot" ) -var _ gobot.AdaptorInterface = (*MqttAdaptor)(nil) +var _ gobot.Adaptor = (*MqttAdaptor)(nil) type MqttAdaptor struct { - gobot.Adaptor + name string Host string clientID string client *mqtt.MqttClient @@ -17,14 +17,12 @@ type MqttAdaptor struct { // NewMqttAdaptor creates a new mqtt adaptor with specified name, host and client id func NewMqttAdaptor(name string, host string, clientID string) *MqttAdaptor { return &MqttAdaptor{ - Adaptor: *gobot.NewAdaptor( - name, - "MqttAdaptor", - ), + name: name, Host: host, clientID: clientID, } } +func (a *MqttAdaptor) Name() string { return a.name } // Connect returns true if connection to mqtt is established func (a *MqttAdaptor) Connect() (errs []error) {
Refactor mqtt to use new adaptor interface
hybridgroup_gobot
train
go
937e277a5bd4b7c2173537a44e8ec28d8f0ea769
diff --git a/force/api.go b/force/api.go index <HASH>..<HASH> 100644 --- a/force/api.go +++ b/force/api.go @@ -203,3 +203,11 @@ func (forceApi *ForceApi) getApiSObjectDescriptions() error { return nil } + +func (forceApi *ForceApi) GetInstanceURL() string { + return forceApi.oauth.InstanceUrl +} + +func (forceApi *ForceApi) GetAccessToken() string { + return forceApi.oauth.AccessToken +}
create methods to get InstanceURL and AccessToken (#<I>)
nimajalali_go-force
train
go
1eebfe97242559b40fb72c4edec85c975d763129
diff --git a/src/urh/controller/CompareFrameController.py b/src/urh/controller/CompareFrameController.py index <HASH>..<HASH> 100644 --- a/src/urh/controller/CompareFrameController.py +++ b/src/urh/controller/CompareFrameController.py @@ -1386,7 +1386,7 @@ class CompareFrameController(QWidget): @pyqtSlot(int) def on_ref_index_changed(self, new_ref_index: int): - if new_ref_index != -1: + if new_ref_index != -1 and self.protocol_model.row_count: hide_correction = 0 for i in range(0, self.protocol_model.row_count): if self.ui.tblViewProtocol.isRowHidden((new_ref_index + i) % self.protocol_model.row_count):
Fix crash when showing diff of empty protocol (#<I>) Fix crash when showing diff of empty protocol
jopohl_urh
train
py
869057d01ed63dbfb08a1bffc22fc3b8f252655f
diff --git a/app/controllers/trackable_item_shelf_locations_controller.rb b/app/controllers/trackable_item_shelf_locations_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/trackable_item_shelf_locations_controller.rb +++ b/app/controllers/trackable_item_shelf_locations_controller.rb @@ -56,9 +56,18 @@ class TrackableItemShelfLocationsController < ApplicationController @tracking_list.allocate! if @successful else - @trackable_item_shelf_location = TrackableItemShelfLocation.new(params[:trackable_item_shelf_location]) + previously_deactivated = params[:trackable_item_shelf_location].merge(:workflow_state => "deactivated") + @trackable_item_shelf_location = TrackableItemShelfLocation.first(:conditions => previously_deactivated) + + if @trackable_item_shelf_location + @trackable_item_shelf_location.reactivate! + @successful = true + else + @trackable_item_shelf_location = TrackableItemShelfLocation.new(params[:trackable_item_shelf_location]) + @successful = @trackable_item_shelf_location.save + end + @trackable_item = @trackable_item_shelf_location.trackable_item - @successful = @trackable_item_shelf_location.save end if @successful
Add reactivation of single allocation for existing
kete_kete_trackable_items
train
rb
08939b5c293591427b7e6d6f7ecbba7435f086c7
diff --git a/src/Thujohn/Share/Share.php b/src/Thujohn/Share/Share.php index <HASH>..<HASH> 100644 --- a/src/Thujohn/Share/Share.php +++ b/src/Thujohn/Share/Share.php @@ -16,6 +16,13 @@ class Share { public function services(){ $services = func_get_args(); + $object = false; + if (end($services) === true) + { + $object = true; + array_pop($services); + } + $return = array(); if ($services){ @@ -26,6 +33,11 @@ class Share { } } + if ($object) + { + return (object) $return; + } + return $return; }
Possibility to return an object from services()
thujohn_share-l4
train
php
ecd1ccdb6f9267ee865bfc054297181f94f162c1
diff --git a/peerdiversity/filter.go b/peerdiversity/filter.go index <HASH>..<HASH> 100644 --- a/peerdiversity/filter.go +++ b/peerdiversity/filter.go @@ -174,7 +174,7 @@ func (f *Filter) TryAdd(p peer.ID) bool { return false } if len(key) == 0 { - dfLog.Debugw("group key is empty", "appKey", f.logKey, "ip", ip.String(), "peer", p) + dfLog.Errorw("group key is empty", "appKey", f.logKey, "ip", ip.String(), "peer", p) return false } group := PeerGroupInfo{Id: p, Cpl: cpl, IPGroupKey: key} @@ -220,6 +220,13 @@ func (f *Filter) ipGroupKey(ip net.IP) (PeerIPGroupKey, error) { if err != nil { return "", fmt.Errorf("failed to fetch ASN for IPv6 addr %s: %w", ip.String(), err) } + + // if no ASN found then fallback on using the /32 prefix + if len(s) == 0 { + dfLog.Debugw("ASN not known", "appKey", f.logKey, "ip", ip) + s = fmt.Sprintf("unknown ASN: %s", net.CIDRMask(32, 128).String()) + } + return PeerIPGroupKey(s), nil default: // If it belongs to a legacy Class 8, we return the /8 prefix as the key
feat: when using the diversity filter for ipv6 addresses if the ASN cannot be found for a particular address then fallback on using the /<I> mask of the address as the group name instead of simply rejecting the peer from routing table
libp2p_go-libp2p-kbucket
train
go
65c708e9e3812285788dfbbaaf9eb3de5730393d
diff --git a/falafel/mappers/redhat_release.py b/falafel/mappers/redhat_release.py index <HASH>..<HASH> 100644 --- a/falafel/mappers/redhat_release.py +++ b/falafel/mappers/redhat_release.py @@ -72,8 +72,3 @@ class RedhatRelease(Mapper): def product(self): """string: product of this OS.""" return self.parsed["product"] - - -if __name__ == "__main__": - import doctest - doctest.testmod()
RedhatRelease tests <I>% code coverage, removing unused doctest system
RedHatInsights_insights-core
train
py
dba8211e2a275c32e5739d6fbe0155b03ec19af2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,8 @@ const RopeSequence = require("rope-sequence") const {Transform, Mapping} = require("../transform") +// FIXME stop relying on timing or take timestamps as input? + // ProseMirror's history isn't simply a way to roll back to a previous // state, because ProseMirror supports applying changes without adding // them to the history (for example during collaboration).
Remove some no-longer-relevant tests
ProseMirror_prosemirror-history
train
js
3eba74173252aad330f7c3379a93b05f240351b5
diff --git a/org.jenetics/src/main/java/org/jenetics/engine/Engine.java b/org.jenetics/src/main/java/org/jenetics/engine/Engine.java index <HASH>..<HASH> 100644 --- a/org.jenetics/src/main/java/org/jenetics/engine/Engine.java +++ b/org.jenetics/src/main/java/org/jenetics/engine/Engine.java @@ -937,6 +937,8 @@ public final class Engine< * The phenotype validator used for detecting invalid individuals. * <i>Default value is set to {@code Phenotype::isValue}.</i> * + * @since 3.1 + * * @param validator the {@code validator} used for validating the * individuals (phenotypes). * @return {@code this} builder, for command chaining @@ -954,6 +956,8 @@ public final class Engine< * The phenotype validator used for detecting invalid individuals. * <i>Default value is set to {@code Genotype::isValue}.</i> * + * @since 3.1 + * * @param validator the {@code validator} used for validating the * individuals (genotypes). * @return {@code this} builder, for command chaining
#<I>: Add version string to new methods.
jenetics_jenetics
train
java
b35f1d94be81f2346ba6549d4276dfe6a3e4a7b5
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Core23\DompdfBundle\DependencyInjection; -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -22,10 +21,14 @@ final class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - - /** @var ArrayNodeDefinition $node */ - $rootNode = $treeBuilder->root('core23_dompdf'); + $treeBuilder = new TreeBuilder('core23_dompdf'); + + // Keep compatibility with symfony/config < 4.2 + if (!\method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->root('core23_dompdf'); + } else { + $rootNode = $treeBuilder->getRootNode(); + } $rootNode ->children()
Removed deprecation warnings
core23_DompdfBundle
train
php
9b05d07b7f27ed4f6d81d026a10e02d97462d02a
diff --git a/lib/templates.js b/lib/templates.js index <HASH>..<HASH> 100644 --- a/lib/templates.js +++ b/lib/templates.js @@ -133,7 +133,11 @@ block = !block ? template : templates.getBlock(template, block); template = parse(block, obj); - return parseFunctions(template, template, obj); + template = parseFunctions(template, template, obj); + template = checkConditionalHelpers(template, obj); + template = cleanup(template, obj); + + return template; } templates.registerHelper = function(name, func) { @@ -417,11 +421,8 @@ if (namespace) { namespace = ''; - } else { - template = checkConditionalHelpers(template, obj); - template = cleanup(template, obj); } - + return template; }
run cleanup only at the end fixes a bug with multiple loops inside one parent loop
benchpressjs_benchpressjs
train
js
0332fa54d10ff357e40ebd979364ca4da6181fb8
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java index <HASH>..<HASH> 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/MamManager.java @@ -995,7 +995,7 @@ public final class MamManager extends Manager { public List<Message> pagePrevious(int count) throws NoResponseException, XMPPErrorException, NotConnectedException, NotLoggedInException, InterruptedException { RSMSet previousResultRsmSet = getPreviousRsmSet(); - RSMSet requestRsmSet = new RSMSet(count, previousResultRsmSet.getLast(), RSMSet.PageDirection.before); + RSMSet requestRsmSet = new RSMSet(count, previousResultRsmSet.getFirst(), RSMSet.PageDirection.before); return page(requestRsmSet); }
Fix previous archive page requested incorrectly in MamManager Previous page should be before the first message in the previous result set, not the last. Fixes SMACK-<I>.
igniterealtime_Smack
train
java
c6ef2f06bd1fed9b966433243b473e65cb932415
diff --git a/src/Attachment/Attachment.php b/src/Attachment/Attachment.php index <HASH>..<HASH> 100644 --- a/src/Attachment/Attachment.php +++ b/src/Attachment/Attachment.php @@ -718,7 +718,7 @@ class Attachment implements AttachmentInterface */ protected function performStringCallable($callable) { - if ( ! preg_match('#^(?<class>[\\a-z0-9_]+)::(?<method>[a-z0-9_]+)$#i', $callable, $matches)) { + if ( ! preg_match('#^(?<class>[\\a-z0-9_]+)@(?<method>[a-z0-9_]+)$#i', $callable, $matches)) { throw new \UnexpectedValueException("Unable to process callable string '{$callable}'"); }
Changed callable hook string format to use @ instead of ::
czim_laravel-paperclip
train
php
e3a89d531491536b0323665986410884e597d3fe
diff --git a/lib/forwarding_dsl/getsetter.rb b/lib/forwarding_dsl/getsetter.rb index <HASH>..<HASH> 100644 --- a/lib/forwarding_dsl/getsetter.rb +++ b/lib/forwarding_dsl/getsetter.rb @@ -13,7 +13,7 @@ module ForwardingDsl if value == NOT_SET instance_variable_get "@#{name}" else - instance_variable_set "@#{name}", value + send "#{name}=", value end end diff --git a/spec/forwarding_dsl/getsetter_spec.rb b/spec/forwarding_dsl/getsetter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/forwarding_dsl/getsetter_spec.rb +++ b/spec/forwarding_dsl/getsetter_spec.rb @@ -31,5 +31,15 @@ RSpec.describe ForwardingDsl::Getsetter do subject.surname 'Test' expect(subject.surname).to eq 'Test' end + + it 'allows overriding the name= method' do + subject_class.class_eval do + getsetter :name + end + + expect(subject).to receive(:name=).with 'Test' + + subject.name 'Test' + end end end
Allows overriding both setters by just overriding name=
manuelmorales_forwarding-dsl
train
rb,rb
e7d411e270343c0f7e886edae1b9767305f575e2
diff --git a/mozilla_django_oidc/auth.py b/mozilla_django_oidc/auth.py index <HASH>..<HASH> 100644 --- a/mozilla_django_oidc/auth.py +++ b/mozilla_django_oidc/auth.py @@ -94,7 +94,7 @@ class OIDCAuthenticationBackend(ModelBackend): """Return object for a newly created user account.""" email = claims.get('email') username = self.get_username(claims) - return self.UserModel.objects.create_user(username, email) + return self.UserModel.objects.create_user(username, email=email) def get_username(self, claims): """Generate username based on claims."""
Fixes #<I> - Pass email as named argument on create_user
mozilla_mozilla-django-oidc
train
py
68e2e061ec604a6af9c43544f4b8cae293930d1b
diff --git a/tracext/github.py b/tracext/github.py index <HASH>..<HASH> 100644 --- a/tracext/github.py +++ b/tracext/github.py @@ -91,14 +91,21 @@ class GitHubPostCommitHook(Component): output = u'Running hook on %s\n' % (reponame or '(default)') if self.autofetch: - output += u'Running git fetch\n' - output += repos.git.repo.fetch() + git = repos.git.repo + output += u'* Running git fetch\n' + output += git.fetch() + output += u'* Updating references\n' + remote_refs = git.for_each_ref( + "--format=%(refname)", "refs/remotes/origin").split() + for remote_ref in remote_refs: + local_ref = remote_ref.replace('remotes/origin', 'heads', 1) + output += git.update_ref(local_ref, remote_ref) data = req.args.get('payload') if data: revs = [str(commit['id']) for commit in json.loads(data)] if revs: - output += u'Adding changesets %s\n' % u', '.join(revs) + output += u'* Adding changesets %s\n' % u', '.join(revs) rm.notify('changeset_added', reponame, revs) req.send(output.encode('utf-8'), 'text/plain', 200 if output else 204)
Keep local branches synchronized with remotes.
trac-hacks_trac-github
train
py
bf147d9a603abefbda0da797504ea02fce3e0ec3
diff --git a/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/ValidationRunStatusID.java b/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/ValidationRunStatusID.java index <HASH>..<HASH> 100644 --- a/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/ValidationRunStatusID.java +++ b/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/ValidationRunStatusID.java @@ -22,7 +22,7 @@ public class ValidationRunStatusID { public static final String PASSED = "PASSED"; public static final ValidationRunStatusID STATUS_PASSED = ValidationRunStatusID.of(PASSED, "Passed", true, true); public static final String WARNING = "WARNING"; - public static final ValidationRunStatusID STATUS_WARNING = ValidationRunStatusID.of(WARNING, "Warning", true, true); + public static final ValidationRunStatusID STATUS_WARNING = ValidationRunStatusID.of(WARNING, "Warning", true, false); private final String id; private final String name;
#<I> Warning is not "passed"
nemerosa_ontrack
train
java
6764910c8188728900cff7c7afb92437094d7849
diff --git a/lib/jasmine-node/async-callback.js b/lib/jasmine-node/async-callback.js index <HASH>..<HASH> 100644 --- a/lib/jasmine-node/async-callback.js +++ b/lib/jasmine-node/async-callback.js @@ -38,7 +38,7 @@ } function asyncSpec(specFunction, spec, timeout) { - if (timeout == null) timeout = jasmine.DEFAULT_TIMEOUT_INTERVAL || 1000; + if (timeout == null) timeout = jasmine.getEnv().defaultTimeoutInterval || 1000; var done = false; spec.runs(function() { try {
Changed the default timeout behavior for the async callbacks to use getEnv().defaultTimeoutInterval instead of DEFAULT_TIMEOUT_INTERVAL. This simplifies configuration changes for the timeout by only requiring a change to the env timout and not both.
mhevery_jasmine-node
train
js
131e8e6e6f69e14ecb335b13f842a7153e75fdcd
diff --git a/agents/builtin/mysql/slowlog/slowlog.go b/agents/builtin/mysql/slowlog/slowlog.go index <HASH>..<HASH> 100644 --- a/agents/builtin/mysql/slowlog/slowlog.go +++ b/agents/builtin/mysql/slowlog/slowlog.go @@ -29,8 +29,6 @@ import ( "github.com/sirupsen/logrus" "gopkg.in/reform.v1" "gopkg.in/reform.v1/dialects/mysql" - - "github.com/percona/pmm-agent/agents/backoff" ) const ( @@ -42,7 +40,6 @@ type SlowLog struct { db *reform.DB l *logrus.Entry changes chan Change - backoff *backoff.Backoff } // Params represent Agent parameters. @@ -75,7 +72,6 @@ func newMySQL(db *reform.DB, l *logrus.Entry) *SlowLog { db: db, l: l, changes: make(chan Change, 10), - backoff: backoff.New(), } }
PMM-<I> Remove backoff.
percona_pmm
train
go