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
a15cc41f037bdd18b4ff83d279cb6e157c798712
diff --git a/ghost/admin/app/controllers/settings/theme.js b/ghost/admin/app/controllers/settings/theme.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/controllers/settings/theme.js +++ b/ghost/admin/app/controllers/settings/theme.js @@ -1,6 +1,5 @@ /* eslint-disable ghost/ember/alias-model-in-controller */ import Controller from '@ember/controller'; -import {computed} from '@ember/object'; import {isEmpty} from '@ember/utils'; import {isThemeValidationError} from 'ghost-admin/services/ajax'; import {notEmpty} from '@ember/object/computed'; @@ -64,12 +63,6 @@ export default Controller.extend({ showDeleteThemeModal: notEmpty('themeToDelete'), - blogUrl: computed('config.blogUrl', function () { - let url = this.get('config.blogUrl'); - - return url.slice(-1) !== '/' ? `${url}/` : url; - }), - actions: { async activateTheme(theme) { const isOverLimit = await this.limit.checkWouldGoOverLimit('customThemes', {value: theme.name});
Removed unused blogUrl CP from theme controller no issue - general cleanup for easier functionality extraction to re-usable components
TryGhost_Ghost
train
js
ce6e6ee3d167e1f5b5493239b214c04af672866e
diff --git a/resource/resourceadapters/opener.go b/resource/resourceadapters/opener.go index <HASH>..<HASH> 100644 --- a/resource/resourceadapters/opener.go +++ b/resource/resourceadapters/opener.go @@ -36,9 +36,22 @@ func NewResourceOpener( // responsibility to close it. func NewResourceOpenerForApplication(st ResourceOpenerState, applicationName string) (opener resource.Opener, err error) { // resourceDownloadLimiter is nil because we only open OCI resources which are json snippets. - return newInternalResourceOpener(st, nil, "", applicationName) + return newInternalResourceOpener(st, func() ResourceDownloadLock { + return noopDownloadResourceLocker{} + }, "", applicationName) } +// noopDownloadResourceLocker is a no-op download resource locker. +type noopDownloadResourceLocker struct{} + +// Acquire grabs the lock for a given application so long as the +// per application limit is not exceeded and total across all +// applications does not exceed the global limit. +func (noopDownloadResourceLocker) Acquire(string) {} + +// Release releases the lock for the given application. +func (noopDownloadResourceLocker) Release(appName string) {} + // NewResourceOpenerState wraps a State pointer for passing into NewResourceOpener/NewResourceOpenerForApplication. func NewResourceOpenerState(st *corestate.State) ResourceOpenerState { return &stateShim{st}
Prevent panic with missing download resource locker The following prevents a panic at runtime because we're missing a download resource locker. The fix is simple, implement a no-op download resource locker that doesn't actually lock anything.
juju_juju
train
go
2877bf21879cc82405b3d46c5f4d46d311de3721
diff --git a/spec/parameters_spec.rb b/spec/parameters_spec.rb index <HASH>..<HASH> 100644 --- a/spec/parameters_spec.rb +++ b/spec/parameters_spec.rb @@ -461,7 +461,6 @@ module ParametersSpec include Origen::Model def initialize - debugger define_params :chain do |params| params.chain = 1 end @@ -469,7 +468,9 @@ module ParametersSpec end ip = IP5.new ip.params = :chain - ip.params(:chain).chain == 1 + ip.params(:chain).chain.should == 1 + ip.params.chain.should == 1 + ip.param?('chain_does_not_exist').should == nil end end end
removed debugger, added a couple more checks
Origen-SDK_origen
train
rb
35d36dce292f33c1f8e6730c0cbb03da52029645
diff --git a/test/daemon_runner/shell_out_test.rb b/test/daemon_runner/shell_out_test.rb index <HASH>..<HASH> 100644 --- a/test/daemon_runner/shell_out_test.rb +++ b/test/daemon_runner/shell_out_test.rb @@ -80,4 +80,17 @@ class ShellOutTest < Minitest::Test shellout = @cmd.run! assert_kind_of Mixlib::ShellOut, shellout end + + def test_defaults_to_zero_for_valid_exit_codes + @cmd = ::TestShellOut.new + shellout = @cmd.run! + assert_equal [0], shellout.valid_exit_codes + end + + def test_allows_custom_valid_exit_codes + @cmd = ::DaemonRunner::ShellOut.new(command: 'exit 1', + valid_exit_codes: [1]) + shellout = @cmd.run! + assert_equal [1], shellout.valid_exit_codes + end end
Fail tests to allow custom valid exit codes for ShellOut.
rapid7_daemon_runner
train
rb
fc4e7a166a77f00f7ba2afee7647851c78447543
diff --git a/lib/calais.js b/lib/calais.js index <HASH>..<HASH> 100644 --- a/lib/calais.js +++ b/lib/calais.js @@ -109,10 +109,12 @@ Calais.prototype = { //ensure the proxy is set if(this.options.proxy) options.proxy = this.options.proxy; - - request(options,function(error,response,calaisData){ - if(!error && response.statusCode == 200) { + request(options,function(error,response,calaisData){ + if (error) { + callback(error); + } + if(response.statusCode == 200) { // take note of whether Javascript object output was requested var jsOutput = (calais.options.outputFormat == 'object'); // parse to a Javascript object if requested @@ -124,10 +126,9 @@ Calais.prototype = { result = (jsOutput && calais.options.cleanResult) ? calais.clean_result(result) : result; - - return callback(result, calais.errors); + return callback(null, result, calais.errors); } else { - return callback('Open Calais Error: ' + error); + return callback(new Error('Open Calais http response error ' + response.statusCode); } }); }
return error type as first callback argument
mcantelon_node-calais
train
js
0ba19367dfa6d25604154dedd533e02c6a4cdb74
diff --git a/niftypet/nimpa/prc/imio.py b/niftypet/nimpa/prc/imio.py index <HASH>..<HASH> 100644 --- a/niftypet/nimpa/prc/imio.py +++ b/niftypet/nimpa/prc/imio.py @@ -74,8 +74,8 @@ def getnii(fim, nan_replace=None, output='image'): dimno = imr.ndim #> get orientations from the affine - ornt = nib.orientations.axcodes2ornt(nib.aff2axcodes(nim.affine)) - trnsp = tuple(np.int8(ornt[::-1,0])) + ornt = nib.io_orientation(nim.affine) + trnsp = tuple(2-np.int8(ornt[:,0])) flip = tuple(np.int8(ornt[:,1])) #> flip y-axis and z-axis and then transpose. Depends if dynamic (4 dimensions) or static (3 dimensions)
fixed bug in imio.py for reading NIfTI images (orientation)
pjmark_NIMPA
train
py
bf33904537fe9322c1adc86e85335146866511d6
diff --git a/lib/gui.rb b/lib/gui.rb index <HASH>..<HASH> 100644 --- a/lib/gui.rb +++ b/lib/gui.rb @@ -10,7 +10,7 @@ class Gui < Gosu::Window def initialize(arena) @arena = arena - create_robot_renderers + @_robot_renderers = {} @_bullet_renderers = {} super(width, height, false) end @@ -35,7 +35,9 @@ class Gui < Gosu::Window end def draw_robots - robot_renderers.each(&:draw) + robots.each do |robot| + robot_renderer(robot).draw + end end def draw_bullets @@ -44,14 +46,18 @@ class Gui < Gosu::Window end end - def create_robot_renderers - @robot_renderers = arena.robots.map { |robot| RobotRenderer.new({ robot: robot, window: self }) } + def robot_renderer(robot) + @_robot_renderers[robot] ||= RobotRenderer.new(window: self, robot: robot) end def bullet_renderer(bullet) @_bullet_renderers[bullet] ||= BulletRenderer.new(window: self, bullet: bullet) end + def robots + arena.robots + end + def bullets arena.bullets end
Don't draw dead robots in gui
mrhead_ruby_arena
train
rb
3ed6966fd522441eb2c1e21be6b0d0b55c32638d
diff --git a/src/Exscript/Connection.py b/src/Exscript/Connection.py index <HASH>..<HASH> 100644 --- a/src/Exscript/Connection.py +++ b/src/Exscript/Connection.py @@ -229,6 +229,34 @@ class Connection(object): self._untrack_accounts() return account + def authenticate(self, account = None, flush = True, lock = True): + """ + Like protocols.Transport.authenticate(), but makes sure to + lock/release the account while it is used. + If an account is not given, one is acquired from the account + manager. + Returns the account that was used to log in. + + @type account: Account + @param account: The account to use for logging in. + @type flush: bool + @param flush: Whether to flush the last prompt from the buffer. + @type lock: bool + @param lock: Whether to lock the account while logging in. + @rtype: Account + @return: The account that was used to log in. + """ + account = self._acquire_account(account, lock) + self._track_account(account) + + try: + self.transport.authenticate(account, flush = flush) + finally: + if lock: + self._release_account(account) + self._untrack_accounts() + return account + def protocol_authenticate(self, account = None, lock = True): """ Like protocols.Transport.protocol_authenticate(), but makes sure to
fix: protect accounts passed to Connection.authenticate() with locking.
knipknap_exscript
train
py
7c1d0c58ab06fc7532e4c75191de5f5a1a0b8432
diff --git a/autograder_sandbox/autograder_sandbox.py b/autograder_sandbox/autograder_sandbox.py index <HASH>..<HASH> 100644 --- a/autograder_sandbox/autograder_sandbox.py +++ b/autograder_sandbox/autograder_sandbox.py @@ -320,9 +320,9 @@ _REDIS_SETTINGS = { } _NEXT_UID_KEY = 'sandbox_next_uid' -redis.StrictRedis(**_REDIS_SETTINGS).setnx('sandbox_next_uid', 2000) def _get_next_linux_uid(): redis_conn = redis.StrictRedis(**_REDIS_SETTINGS) + redis_conn.setnx('sandbox_next_uid', 2000) return redis_conn.incr(_NEXT_UID_KEY)
Delayed connecting to redis and initializing the linux uid value until a linux uid is requested.
eecs-autograder_autograder-sandbox
train
py
79505d141794b8fd333bfa98dc6526d0d1a9acac
diff --git a/pyinfra/modules/server.py b/pyinfra/modules/server.py index <HASH>..<HASH> 100644 --- a/pyinfra/modules/server.py +++ b/pyinfra/modules/server.py @@ -385,7 +385,7 @@ def user( if groups: args.append('-G {0}'.format(','.join(groups))) - if system and host.fact.os not in ('OpenBSD', 'NetBSD'): + if system and 'BSD' not in host.fact.os: args.append('-r') if uid:
Make check for BSD in host OS consistent between `server.group` and `server.user`.
Fizzadar_pyinfra
train
py
9584cccd2634aee568f5a21584abaeeaa01440d5
diff --git a/admin/controllers/shop.php b/admin/controllers/shop.php index <HASH>..<HASH> 100644 --- a/admin/controllers/shop.php +++ b/admin/controllers/shop.php @@ -4321,6 +4321,7 @@ class NAILS_Shop extends NAILS_Admin_Controller // Fetch all variants which are out of stock $this->db->select( 'p.id product_id, p.label product_label, v.id variation_id, v.label variation_label, v.sku, v.quantity_available' ); + $this->db->select( '(SELECT GROUP_CONCAT(DISTINCT `b`.`label` ORDER BY `b`.`label` SEPARATOR \', \') FROM `' . NAILS_DB_PREFIX . 'shop_product_brand` pb JOIN `' . NAILS_DB_PREFIX . 'shop_brand` b ON `b`.`id` = `pb`.`brand_id` WHERE `pb`.`product_id` = `p`.`id` GROUP BY `pb`.`product_id`) brands', FALSE ); $this->db->join( NAILS_DB_PREFIX . 'shop_product p', 'p.id = v.product_id', 'LEFT' ); $this->db->where( 'v.stock_status', 'OUT_OF_STOCK' ); $_out->data = $this->db->get( NAILS_DB_PREFIX . 'shop_product_variation v' )->result_array();
Adding brands to "out of stock" report
nails_module-admin
train
php
56a2e56b1ca9d881c532982f0fe16cf7897a6950
diff --git a/core/server/scheduling/post-scheduling/index.js b/core/server/scheduling/post-scheduling/index.js index <HASH>..<HASH> 100644 --- a/core/server/scheduling/post-scheduling/index.js +++ b/core/server/scheduling/post-scheduling/index.js @@ -27,12 +27,10 @@ _private.loadClient = function loadClient() { }; _private.loadScheduledPosts = function () { - return schedules.getScheduledPosts({ - from: moment().subtract(7, 'days').startOf('day').toDate(), - to: moment().endOf('day').toDate() - }).then(function (result) { - return result.posts || []; - }); + return schedules.getScheduledPosts() + .then(function (result) { + return result.posts || []; + }); }; exports.init = function init(options) {
🎨 fetch all scheduled posts on bootstrap (#<I>) refs #<I> - remove filters, they can cause problems
TryGhost_Ghost
train
js
e71dacc4f68269074c47952f5c2354accfaf3a16
diff --git a/atest/servercontroller.py b/atest/servercontroller.py index <HASH>..<HASH> 100644 --- a/atest/servercontroller.py +++ b/atest/servercontroller.py @@ -25,6 +25,7 @@ import socket from os.path import abspath, dirname, exists, join import os import sys +import glob BASE = dirname(abspath(__file__)) @@ -38,7 +39,10 @@ def start(libraries= cmd = 'mvn -f "%s" clean package' % os.path.join(BASE, 'libs', 'pom.xml') print 'Building the test libraries with command:\n%s' % cmd subprocess.call(cmd, shell=True) - rs_path = os.path.join(dirname(BASE), 'target', 'jrobotremoteserver-jar-with-dependencies.jar') + files = glob.glob(os.path.join(dirname(BASE), 'target') + os.sep + '*jar-with-dependencies.jar') + if not files: + raise Exception('Build jrobotremoteserver including the standalone jar first') + rs_path = os.path.join(dirname(BASE), 'target', files[0]) tl_path = os.path.join(BASE, 'libs', 'target', 'examplelib-jar-with-dependencies.jar') os.environ['CLASSPATH'] = rs_path + os.pathsep + tl_path print 'CLASSPATH: %s' % os.environ['CLASSPATH']
handle changing filename of main jar
ombre42_jrobotremoteserver
train
py
0934bbc26be54d92c39aa4c90675073ad3a55ad8
diff --git a/lib/tdiary/environment.rb b/lib/tdiary/environment.rb index <HASH>..<HASH> 100644 --- a/lib/tdiary/environment.rb +++ b/lib/tdiary/environment.rb @@ -14,7 +14,9 @@ if defined?(Bundler) env = [:default, :rack] env << :development if ENV['RACK_ENV'].nil? || ENV['RACK_ENV'].empty? env << ENV['RACK_ENV'].intern if ENV['RACK_ENV'] - env = env.reject{|e| Bundler.settings.without.include? e } + env = env.reject{|e| + (Bundler.settings.without rescue Bundler.settings[:without]).include? e + } Bundler.require *env end
fix incompatibirity between bundler <I> and <I> (#<I>) * Bundler::Settings#without is deprecated in <I> * Bundler::Settings#[] will return nil in <I> => try <I> style then <I> style after exception
tdiary_tdiary-core
train
rb
35bb44aa0b057ed99076718e6e347df6b381e5dc
diff --git a/hearthstone/cardxml.py b/hearthstone/cardxml.py index <HASH>..<HASH> 100644 --- a/hearthstone/cardxml.py +++ b/hearthstone/cardxml.py @@ -1,4 +1,4 @@ -from xml.etree import ElementTree +from lxml import etree as ElementTree from .enums import ( CardClass, CardType, CardSet, Faction, GameTag, MultiClassGroup, Race, Rarity, PlayReq, Type diff --git a/hearthstone/dbf.py b/hearthstone/dbf.py index <HASH>..<HASH> 100644 --- a/hearthstone/dbf.py +++ b/hearthstone/dbf.py @@ -1,8 +1,5 @@ from collections import OrderedDict -try: - from lxml import etree as ElementTree -except ImportError: - from xml.etree import ElementTree +from lxml import etree as ElementTree class Dbf:
cardxml, dbf: Require lxml for all xml processing
HearthSim_python-hearthstone
train
py,py
48ab33054fb14fb567aff8b55eb883d46b4e82a6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,8 @@ with open('databench/__init__.py', 'r') as f: # add argparse dependency for python < 2.7 major, minor1, minor2, release, serial = sys.version_info if major <= 2 and minor1 < 7: - INSTALL_REQUIRES.append('argparse==1.2.1') + INSTALL_REQUIRES.append('argparse>=1.2.1') + INSTALL_REQUIRES.append('importlib>=1.0.3') setup(
explicitely require importlib for Python <I>
svenkreiss_databench
train
py
d6db7d40863bd22ca84aa1da69896ffc542ce656
diff --git a/src/main/java/water/Boot.java b/src/main/java/water/Boot.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/Boot.java +++ b/src/main/java/water/Boot.java @@ -122,7 +122,14 @@ public class Boot extends ClassLoader { public static void main(String[] args) throws Exception { _init.boot(args); } // NOTE: This method cannot be run from jar public static void main(Class main, String[] args) throws Exception { - weavePackage(main.getPackage().getName()); + String[] packageNamesToWeave = { main.getPackage().getName()} ; + main(main, args, packageNamesToWeave); + } + // NOTE: This method cannot be run from jar + public static void main(Class main, String[] args, String[] packageNamesToWeave) throws Exception{ + for (String packageName : packageNamesToWeave) { + weavePackage(packageName); + } ArrayList<String> l = new ArrayList<String>(Arrays.asList(args)); l.add(0, "-mainClass"); l.add(1, main.getName());
Add one more version of main that lets the user pass in packageNamesToWeave.
h2oai_h2o-2
train
java
c3202811e6478529fc9d9181ff4f4fa7299e313e
diff --git a/test/cases/helper.rb b/test/cases/helper.rb index <HASH>..<HASH> 100644 --- a/test/cases/helper.rb +++ b/test/cases/helper.rb @@ -58,6 +58,15 @@ def supports_default_expression? end end +def supports_text_column_with_default? + if current_adapter?(:Mysql2Adapter) + conn = ActiveRecord::Base.connection + conn.mariadb? && conn.database_version >= "10.2.1" + else + true + end +end + %w[ supports_savepoints? supports_partial_index?
Add supports_text_column_with_default test helper This was backported to Rails <I> in <URL>
cockroachdb_activerecord-cockroachdb-adapter
train
rb
c8285e82eea7e0d1e7aa31b07027e9f9667a2f1b
diff --git a/lib/wired/builders/app_builder.rb b/lib/wired/builders/app_builder.rb index <HASH>..<HASH> 100644 --- a/lib/wired/builders/app_builder.rb +++ b/lib/wired/builders/app_builder.rb @@ -210,8 +210,8 @@ module Wired exit end - %w(papertrail mandrill newrelic memcachier).each do |addon| - run "heroku addons:create #{addon} --remote #{env}" + [["papertrail","choklad"], ["newrelic","wayne"], ["memcachier","dev"]].each do |service, plan| + run "heroku addons:create #{service}:#{plan} --remote #{env}" end if env == 'production'
remove mandril service since the free service is gone. To prevent adding paid versions of other addons, specify a plan.
wirelab_wired
train
rb
0520c148d7a9a3b94b4a832974ab3c824f659cb9
diff --git a/lib/chef/provider/service/systemd.rb b/lib/chef/provider/service/systemd.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/service/systemd.rb +++ b/lib/chef/provider/service/systemd.rb @@ -72,17 +72,17 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple def get_systemctl_options_args if new_resource.user - uid = node['etc']['passwd'][new_resource.user]['uid'] + uid = node["etc"]["passwd"][new_resource.user]["uid"] options = { - 'environment' => { - 'DBUS_SESSION_BUS_ADDRESS' => "unix:path=/run/user/#{uid}/bus", + "environment" => { + "DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus", }, - 'user' => new_resource.user, + "user" => new_resource.user, } - args = '--user' + args = "--user" else options = {} - args = '--system' + args = "--system" end return options, args
double quotes to make rubocop happy
chef_chef
train
rb
1223f94cb2f3c546468a2a3063456efbc5e155fe
diff --git a/mailqueue/models.py b/mailqueue/models.py index <HASH>..<HASH> 100644 --- a/mailqueue/models.py +++ b/mailqueue/models.py @@ -150,4 +150,4 @@ class Attachment(models.Model): verbose_name_plural = _('Attachments') def __str__(self): - return self.original_filename + return str(self.original_filename)
#<I> Don't break django.debug.technical_<I>_response when Attachment.original_filename is None
dstegelman_django-mail-queue
train
py
a21d04b804b15c6c8936ed5e57120b339b9bef6d
diff --git a/blocks/text.js b/blocks/text.js index <HASH>..<HASH> 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -717,7 +717,7 @@ Blockly.Blocks['text_count'] = { ], "output": "Number", "inputsInline": true, - "colour": Blockly.Blocks.math.HUE, + "colour": Blockly.Blocks.texts.HUE, "tooltip": Blockly.Msg.TEXT_COUNT_TOOLTIP, "helpUrl": Blockly.Msg.TEXT_COUNT_HELPURL });
Making text_count use a text color (like text_length, which also returns a number). (#<I>)
LLK_scratch-blocks
train
js
84ffbfeff74fec4220319cac60a7654bbaef0b63
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( description='A tool to pipe linters into code review', requires=['requests'], entry_points={ - 'linters': [ + 'imhotep_linters': [ '.js = tools:JSHint', '.py = tools:PyLint [pylint]' ],
linters => imhotep_linters to prevent name collision.
justinabrahms_imhotep
train
py
52f64a3e5d2cb544ff687801f45496c043bd9d05
diff --git a/example/example.php b/example/example.php index <HASH>..<HASH> 100644 --- a/example/example.php +++ b/example/example.php @@ -1,4 +1,12 @@ <?php +/** + * This file is part of phpab/phpab (https://github.com/phpab/phpab) + * + * @link https://github.com/phpab/phpab for the canonical source repository + * @copyright Copyright (c) 2015-2016 phpab. (https://github.com/phpab) + * @license https://raw.githubusercontent.com/phpab/phpab/master/LICENSE MIT + */ + require '../vendor/autoload.php'; use PhpAb\AbRunner;
Added a docblock (also to test this commit - it should bind to issue #4)
phpab_phpab
train
php
2d87610a7d8862153e29ec4bee5fc1525a3488d6
diff --git a/packages/ember-metal/lib/computed.js b/packages/ember-metal/lib/computed.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/computed.js +++ b/packages/ember-metal/lib/computed.js @@ -664,6 +664,23 @@ registerComputedWithProperties('map', function(properties) { }); /** + Creates a new property that is an alias for another property + on an object. Calls to `get` or `set` this property behave as + though they were called on the original property. + + ```javascript + Person = Ember.Object.extend({ + name: 'Alex Matchneer', + nomen: Ember.computed.alias('name') + }); + + alex = Person.create(); + alex.get('nomen'); // 'Alex Matchneer' + alex.get('name'); // 'Alex Matchneer' + + alex.set('nomen', '@machty'); + alex.get('name'); // '@machty' + ``` @method computed.alias @for Ember @param {String} dependentKey
Example for Ember.computed.alias
emberjs_ember.js
train
js
c93599ff54faf53730e64d35e4f9a1d550fe5902
diff --git a/lib/discordrb/container.rb b/lib/discordrb/container.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/container.rb +++ b/lib/discordrb/container.rb @@ -74,10 +74,24 @@ module Discordrb register_event(TypingEvent, attributes, block) end + # This **event** is raised when a message is edited in a channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [#resolve_id] :id Matches the ID of the message that was edited. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was edited in. + # @yield The block is executed when the event is raised. + # @yieldparam event [MessageEditEvent] The event that was raised. + # @return [MessageEditEventHandler] The event handler that was registered. def message_edit(attributes = {}, &block) register_event(MessageEditEvent, attributes, block) end + # This **event** is raised when a message is deleted in a channel. + # @param attributes [Hash] The event's attributes. + # @option attributes [#resolve_id] :id Matches the ID of the message that was deleted. + # @option attributes [String, Integer, Channel] :in Matches the channel the message was deleted in. + # @yield The block is executed when the event is raised. + # @yieldparam event [MessageDeleteEvent] The event that was raised. + # @return [MessageDeleteEventHandler] The event handler that was registered. def message_delete(attributes = {}, &block) register_event(MessageDeleteEvent, attributes, block) end
Document message_edit and message_delete
meew0_discordrb
train
rb
e2e672740a6e58f81924406decba024a239fb8a5
diff --git a/gson/src/main/java/com/google/gson/GsonBuilder.java b/gson/src/main/java/com/google/gson/GsonBuilder.java index <HASH>..<HASH> 100644 --- a/gson/src/main/java/com/google/gson/GsonBuilder.java +++ b/gson/src/main/java/com/google/gson/GsonBuilder.java @@ -541,9 +541,9 @@ public final class GsonBuilder { */ public Gson create() { List<TypeAdapter.Factory> factories = new ArrayList<TypeAdapter.Factory>(); - factories.addAll(this.hierarchyFactories); factories.addAll(this.factories); Collections.reverse(factories); + factories.addAll(this.hierarchyFactories); addTypeAdaptersForDate(datePattern, dateStyle, timeStyle, factories); return new Gson(excluder, fieldNamingPolicy, instanceCreators,
Fix broken test in registering competing type hierarchy adapters. I actually tried to replicate this test but got an error "type adapters conflict" when I was doing it. I suspect the problem was that I was trying to use 'Object' as the base of my type hierarchy and that class is somehow special.
google_gson
train
java
2a5fb117f20658edb9205cf61576544aa9601b18
diff --git a/sdk/Network/Http/Rest.php b/sdk/Network/Http/Rest.php index <HASH>..<HASH> 100644 --- a/sdk/Network/Http/Rest.php +++ b/sdk/Network/Http/Rest.php @@ -103,7 +103,7 @@ class Rest $data[$key] = $file; } else { $data = json_encode($data); - $this->header['Content-Length'] = strlen($data); + $header['Content-Length'] = strlen($data); } } $response = Socket::$method(
Content-Length Header must be used for the current request only and not saved for future requests. fixes #1 .
LibreDTE_libredte-sdk-php
train
php
9fe5bfa2b9775a9459647d28d52ec7890711b887
diff --git a/lib/sidekiq/batch/status.rb b/lib/sidekiq/batch/status.rb index <HASH>..<HASH> 100644 --- a/lib/sidekiq/batch/status.rb +++ b/lib/sidekiq/batch/status.rb @@ -39,6 +39,10 @@ module Sidekiq 'true' == Sidekiq.redis { |r| r.hget("BID-#{bid}", 'complete') } end + def child_count + Sidekiq.redis { |r| r.hget("BID-#{bid}", 'children') }.to_i + end + def data { total: total,
Added child_count to status to perform better testing
breamware_sidekiq-batch
train
rb
bcd0629ed6d5e6e8dd0958bc56f0bba88625025a
diff --git a/peri/viz/interaction.py b/peri/viz/interaction.py index <HASH>..<HASH> 100644 --- a/peri/viz/interaction.py +++ b/peri/viz/interaction.py @@ -322,6 +322,7 @@ class OrthoManipulator(object): new_err = self.state.error print '{}->{}'.format(old_err, new_err) + self.state.set_tile(self.state.oshape) self.set_field() self.draw()
Setting tile after optimization in OrthoManipulator
peri-source_peri
train
py
c0697baf317d6a185778a76124333468eb19805b
diff --git a/a10_openstack_lib/resources/a10_scaling_group.py b/a10_openstack_lib/resources/a10_scaling_group.py index <HASH>..<HASH> 100644 --- a/a10_openstack_lib/resources/a10_scaling_group.py +++ b/a10_openstack_lib/resources/a10_scaling_group.py @@ -258,7 +258,7 @@ RESOURCE_ATTRIBUTE_MAP = { 'reactions': { 'allow_post': True, 'allow_put': True, - 'convert_to': lambda attr: attr.convert_to_list, + 'convert_list_to': lambda attr: attr.convert_kvp_list_to_dict, 'is_visible': True, 'default': lambda attr: attr.ATTR_NOT_SPECIFIED }
Restored kvp_to_dict functionality I accidentally broke
a10networks_a10-openstack-lib
train
py
6eca2a93cd4776fd7d2c1ab560dba43e523a5383
diff --git a/tests/config/database.php b/tests/config/database.php index <HASH>..<HASH> 100644 --- a/tests/config/database.php +++ b/tests/config/database.php @@ -7,7 +7,7 @@ return [ 'connections' => [ 'travis' => [ 'driver' => 'c5_pdo_mysql', - 'server' => 'localhost', + 'server' => '127.0.0.1', 'database' => 'concrete5_tests', 'username' => 'travis', 'password' => '', @@ -18,7 +18,7 @@ return [ ], 'travisWithoutDB' => [ 'driver' => 'c5_pdo_mysql', - 'server' => 'localhost', + 'server' => '127.0.0.1', 'username' => 'travis', 'password' => '', 'charset' => 'utf8',
Use <I> instead of localhost in test DB connection Using localhost prevents from running tests in WSL
concrete5_concrete5
train
php
3c5506c8505788a4329a4edb11c2324eb4f841c5
diff --git a/src/dav.js b/src/dav.js index <HASH>..<HASH> 100644 --- a/src/dav.js +++ b/src/dav.js @@ -172,11 +172,19 @@ class DavSDK { if (!region.radius) throw new Error('region radius is not set'); } region.ttl = region.ttl || 120; - axios.post(`${dav.missionControlURL}/captains/${dav.davId}`, { need_type: needType, region }) + + const registerNeedTypeForCaptain = () => axios.post(`${dav.missionControlURL}/captains/${dav.davId}`, { need_type: needType, region }) .catch((err) => { console.error(err); }); + registerNeedTypeForCaptain(); + + rx.Observable.interval(90000 /*1.5m*/).subscribe( + registerNeedTypeForCaptain, + (err) => console.log('Error: ' + err), + () => console.log('')); + const observable = new rx.Subject(); dav.needTypes[needType] = observable;
registerNeedTypeForCaptain every <I> seconds
DAVFoundation_dav-js
train
js
869d8d97e68615898c504aa0f624fb91540a697a
diff --git a/versions/admin.py b/versions/admin.py index <HASH>..<HASH> 100644 --- a/versions/admin.py +++ b/versions/admin.py @@ -62,16 +62,21 @@ class VersionableAdmin(ModelAdmin): """need a getter for exclude since there is no get_exclude method to be overridden""" VERSIONABLE_EXCLUDE = ['id', 'identity', 'version_end_date', 'version_start_date', 'version_birth_date'] #creating _exclude so that self.exclude doesn't need to be called prompting recursion, and subclasses - #hava way to change what is excluded + #have a way to change what is excluded if self._exclude is None: return VERSIONABLE_EXCLUDE else: return list(self._exclude) + VERSIONABLE_EXCLUDE def get_form(self, request, obj=None, **kwargs): + + form = super(VersionableAdmin,self).get_form(request,obj,**kwargs) + if request.method == 'POST' and obj is not None: obj = obj.clone() - form = super(VersionableAdmin,self).get_form(request,obj,**kwargs) + print "It was cloned" + #this is printing out twice for some reason and we get two instances of each object + return form def is_current(self, obj):
Comments on get_form since that isn't working quite right
swisscom_cleanerversion
train
py
9e97df04e5392d43778a863ca39ddb1ebd26dbb7
diff --git a/synapse/tests/test_cortex.py b/synapse/tests/test_cortex.py index <HASH>..<HASH> 100644 --- a/synapse/tests/test_cortex.py +++ b/synapse/tests/test_cortex.py @@ -797,6 +797,10 @@ class CortexTest(SynTest): self.eq(core1.getBlobValu('syn:test'), 1234) self.eq(core1.getBlobValu('syn:core:created'), created) + # Persist a value which will be overwritten by a storage layer event + core1.setBlobValu('syn:core:sqlite:version', -2) + core1.hasBlobValu('syn:core:sqlite:version') + fd.seek(0) time.sleep(1) @@ -816,6 +820,8 @@ class CortexTest(SynTest): # blobstores persist across storage types with savefiles self.eq(core2.getBlobValu('syn:test'), 1234) self.eq(core2.getBlobValu('syn:core:created'), created) + # Ensure that storage layer values may trump whatever was in a savefile + self.ge(core2.getBlobValu('syn:core:sqlite:version'), 0) core2.fini()
Add test to ensure savefile contents are trump by storage layer values.
vertexproject_synapse
train
py
2bc77f6e1067b6a39c0b3a944823d72ca99c36e2
diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index <HASH>..<HASH> 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -2761,5 +2761,5 @@ class HTTPErrorTest(unittest.TestCase): class ApplicationTest(AsyncTestCase): def test_listen(self): app = Application([]) - server = app.listen(0) + server = app.listen(0, address='127.0.0.1') server.stop()
Fix firewall prompts when running tests.
tornadoweb_tornado
train
py
2f29ee130c241cecda3ce8bd184dc3b06fbcef31
diff --git a/rss/rsslib.php b/rss/rsslib.php index <HASH>..<HASH> 100644 --- a/rss/rsslib.php +++ b/rss/rsslib.php @@ -40,6 +40,12 @@ function cron_rss_feeds () { echo " Generating rssfeeds...\n"; + //Check for required functions... + if(!function_exists('utf8_encode')) { + echo " ERROR: You need to add XML support to your PHP installation!\n"; + return true; + } + if ($allmods = get_records("modules") ) { foreach ($allmods as $mod) { echo ' '.$mod->name.': ';
Now scheduled bakup checks for required XML functions to work. Bug <I>. Closed now... :-) (<URL>)
moodle_moodle
train
php
af83a45d162b0cff2d81aa4a6769de8e4792e759
diff --git a/lib/marvel/error.rb b/lib/marvel/error.rb index <HASH>..<HASH> 100644 --- a/lib/marvel/error.rb +++ b/lib/marvel/error.rb @@ -1,15 +1,15 @@ module Marvel module Response class Error < StandardError + attr_reader :code, :status def initialize(response_hash) - response_hash.each do |key, value| - instance_variable_set("@#{key}", value) - end + @code = response_hash['code'] + @status = response_hash['status'] || response_hash['message'] end def to_s - instance_variables.map { |var| instance_variable_get(var) } * ' ' + "#{@code} #{@status}" end end end
Creates Error class sans dynamic definition
O-I_marvel
train
rb
557b8c0d55cb7d3e7c086713c24edd8fbd8fda8a
diff --git a/bakery/project/models.py b/bakery/project/models.py index <HASH>..<HASH> 100644 --- a/bakery/project/models.py +++ b/bakery/project/models.py @@ -67,6 +67,18 @@ class Project(db.Model): return self.config['local'].get('source', None) @property + def source_files_type(self): + if self.config['state'].get('source_files_type'): + return self.config['state']['source_files_type'] + else: + if self.config['local']['ufo_dirs']: + return 'ufo' + elif self.config['local']['ttx_files']: + return 'ttx' + else: + return None + + @property def title(self): """ Return project title, resolved from repo clone if no rename family name given
Autodetect source type for repository
googlefonts_fontbakery
train
py
2eab6ea071404baf636ba874aada47e90f0239d2
diff --git a/src/app/Models/Avatar.php b/src/app/Models/Avatar.php index <HASH>..<HASH> 100644 --- a/src/app/Models/Avatar.php +++ b/src/app/Models/Avatar.php @@ -21,6 +21,9 @@ class Avatar extends Model implements Attachable protected $fillable = ['user_id', 'original_name', 'saved_name']; protected $hidden = ['user_id', 'created_at', 'updated_at']; + protected $casts = [ + 'user_id' => 'int', + ]; public function user() {
Ensure user_id is an integer Caused type-mismatch when comparing to `$user->id` in `AvatarPolicy->update(...)` during tests on certain configurations (both windows & linux)
laravel-enso_AvatarManager
train
php
1bac5d8e5d319121cfc151f3ac8cc2b352322758
diff --git a/spec/lib/combi/buses/http_spec.rb b/spec/lib/combi/buses/http_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/combi/buses/http_spec.rb +++ b/spec/lib/combi/buses/http_spec.rb @@ -8,10 +8,8 @@ describe 'Combi::Http' do When(:bus) { Combi::ServiceBus.init_for(:http, {}) } Then { Combi::Http === bus } end - Given(:handler) { double('handler', on_open: nil) } Given(:client_options) do - { remote_api: 'http://localhost:9292/', - handler: handler } + { remote_api: 'http://localhost:9292/' } end Given(:http_server) { Combi::ServiceBus.init_for(:http, {} )} Given(:subject) { Combi::ServiceBus.init_for(:http, client_options) }
http bus doesn't require a handler for sessions
1uptalent_combi
train
rb
a054fd779ca3ea3efaf7c85d18cfb8640c1d594c
diff --git a/driver/src/test/unit/com/mongodb/DBTest.java b/driver/src/test/unit/com/mongodb/DBTest.java index <HASH>..<HASH> 100644 --- a/driver/src/test/unit/com/mongodb/DBTest.java +++ b/driver/src/test/unit/com/mongodb/DBTest.java @@ -339,7 +339,7 @@ public class DBTest extends DatabaseTestCase { // Then assertThat(commandResult.ok(), is(false)); - assertThat(commandResult.getErrorMessage(), is("no such cmd: NotRealCommandName")); + assertThat(commandResult.getErrorMessage(), containsString("no such")); } @Test
Relaxing test to handle change in error message from MongoDB <I>
mongodb_mongo-java-driver
train
java
a645ae0583acbfb6115e161fd20ea66bce848e92
diff --git a/lib/6to5/transformation/transformers/es6-spread.js b/lib/6to5/transformation/transformers/es6-spread.js index <HASH>..<HASH> 100644 --- a/lib/6to5/transformation/transformers/es6-spread.js +++ b/lib/6to5/transformation/transformers/es6-spread.js @@ -83,6 +83,8 @@ exports.CallExpression = function (node, parent, file, scope) { if (temp) { callee.object = t.assignmentExpression("=", temp, callee.object); contextLiteral = temp; + } else { + contextLiteral = callee.object; } t.appendToMemberExpression(callee, t.identifier("apply")); } else {
contextLiteral fallback in es6-spread transformer
babel_babel
train
js
42d3b467fbec32b1314042271c2a08c798ce025f
diff --git a/pyrogram/client/types/__init__.py b/pyrogram/client/types/__init__.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/types/__init__.py +++ b/pyrogram/client/types/__init__.py @@ -28,13 +28,11 @@ from .input_media import ( InputMediaAudio, InputPhoneContact, InputMediaVideo, InputMediaPhoto, InputMediaDocument, InputMediaAnimation ) -from .media import ( +from .messages_and_media import ( Audio, Contact, Document, Animation, Location, Photo, PhotoSize, - Sticker, Venue, Video, VideoNote, Voice, UserProfilePhotos + Sticker, Venue, Video, VideoNote, Voice, UserProfilePhotos, + Message, Messages, MessageEntity ) -from .message import Message -from .message_entity import MessageEntity -from .messages import Messages from .update import Update from .user_and_chats import ( Chat, ChatMember, ChatMembers, ChatPhoto,
Fix init not having message and media types
pyrogram_pyrogram
train
py
3ee898aa6f4fac3a0b62fca973dc677e244f65da
diff --git a/datadog_checks_base/datadog_checks/base/stubs/aggregator.py b/datadog_checks_base/datadog_checks/base/stubs/aggregator.py index <HASH>..<HASH> 100644 --- a/datadog_checks_base/datadog_checks/base/stubs/aggregator.py +++ b/datadog_checks_base/datadog_checks/base/stubs/aggregator.py @@ -256,6 +256,9 @@ class AggregatorStub(object): if hostname and hostname != bucket.hostname: continue + if monotonic != bucket.monotonic: + continue + candidates.append(bucket) expected_bucket = HistogramBucketStub(name, value, lower_bound, upper_bound, monotonic, hostname, tags)
Check monotonic in assert_histogram_bucket (#<I>)
DataDog_integrations-core
train
py
d8869b1a9ab821e85155f5291534266cb3c7bf30
diff --git a/rkt/prepare.go b/rkt/prepare.go index <HASH>..<HASH> 100644 --- a/rkt/prepare.go +++ b/rkt/prepare.go @@ -30,7 +30,7 @@ var ( cmdPrepare = &Command{ Name: "prepare", Summary: "Prepare to run image(s) in an application container in rocket", - Usage: "[--volume name,type=host...] [--quiet] IMAGE [-- image-args...[---]]...", + Usage: "[--volume name,kind=host,...] [--quiet] IMAGE [-- image-args...[---]]...", Description: `Image should be a string referencing an image; either a hash, local file on disk, or URL. They will be checked in that order and the first match will be used. diff --git a/rkt/run.go b/rkt/run.go index <HASH>..<HASH> 100644 --- a/rkt/run.go +++ b/rkt/run.go @@ -42,7 +42,7 @@ var ( cmdRun = &Command{ Name: "run", Summary: "Run image(s) in an application container in rocket", - Usage: "[--volume name,type=host...] IMAGE [-- image-args...[---]]...", + Usage: "[--volume name,kind=host,...] IMAGE [-- image-args...[---]]...", Description: `IMAGE should be a string referencing an image; either a hash, local file on disk, or URL. They will be checked in that order and the first match will be used.
rkt: fix volume example in run/prepare The example in the help text is wrong and conflicts with the docs, fix this.
rkt_rkt
train
go,go
0613b22f0bb081ce94879b3a7dde10f4f31178f6
diff --git a/proso_questions_client/static/js/services.js b/proso_questions_client/static/js/services.js index <HASH>..<HASH> 100644 --- a/proso_questions_client/static/js/services.js +++ b/proso_questions_client/static/js/services.js @@ -105,6 +105,7 @@ }; var promise = $http.get(url, options).success(function(data) { fn(data.data); + user.initCsfrtoken(); }); return promise; },
initCsrftoken also in test
adaptive-learning_proso-apps
train
js
345dedad719dcddc8e3a84f40a8cdd23f4c6e82e
diff --git a/core/support/src/main/java/au/com/dius/pact/core/support/json/BaseJsonLexer.java b/core/support/src/main/java/au/com/dius/pact/core/support/json/BaseJsonLexer.java index <HASH>..<HASH> 100644 --- a/core/support/src/main/java/au/com/dius/pact/core/support/json/BaseJsonLexer.java +++ b/core/support/src/main/java/au/com/dius/pact/core/support/json/BaseJsonLexer.java @@ -94,7 +94,7 @@ public class BaseJsonLexer { } private char[] allocate(char[] buffer, int size) { - char[] newBuffer = new char[Math.max(buffer.length * 2, size)]; + char[] newBuffer = new char[buffer.length + size]; System.arraycopy(buffer, 0, newBuffer, 0, buffer.length); return newBuffer; }
fix the size of the buffer used when scanning decimal numbers
DiUS_pact-jvm
train
java
bbadb4ba0ed8544a1a154072404d86cb55baacd7
diff --git a/pippo-template-parent/pippo-pebble/src/main/java/ro/pippo/pebble/PrettyTimeExtension.java b/pippo-template-parent/pippo-pebble/src/main/java/ro/pippo/pebble/PrettyTimeExtension.java index <HASH>..<HASH> 100644 --- a/pippo-template-parent/pippo-pebble/src/main/java/ro/pippo/pebble/PrettyTimeExtension.java +++ b/pippo-template-parent/pippo-pebble/src/main/java/ro/pippo/pebble/PrettyTimeExtension.java @@ -23,6 +23,7 @@ import com.mitchellbosecke.pebble.template.EvaluationContext; import com.mitchellbosecke.pebble.template.PebbleTemplate; import org.ocpsoft.prettytime.PrettyTime; +import java.time.ZonedDateTime; import java.util.Calendar; import java.util.Collections; import java.util.Date; @@ -79,6 +80,8 @@ public class PrettyTimeExtension extends AbstractExtension { return ((Calendar) value).getTime(); } else if (value instanceof Long) { return new Date((Long) value); + } else if (value instanceof ZonedDateTime) { + return Date.from(((ZonedDateTime) value).toInstant()); } else { throw new RuntimeException("Formattable object for PrettyTime not found!"); }
Deal with ZonedDateTime in Pebble's PrettyTimeExtension
pippo-java_pippo
train
java
ffd58af425c8720b4acc402cf63e53c765cc7160
diff --git a/lib/jekyll-incremental.rb b/lib/jekyll-incremental.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll-incremental.rb +++ b/lib/jekyll-incremental.rb @@ -31,8 +31,8 @@ module Jekyll # -- def regenerate?(doc) return false unless doc.write? + return true if doc.respond_to?(:asset_file?) && doc.asset_file? return true if forced_by_data?(doc) - return true if doc&.asset_file? modified?(doc) end
Make a proper fix, it should be respond_to?
anomaly_jekyll-incremental
train
rb
b4a23e2bcf82b57bad09bde00848a7bd81ae7208
diff --git a/httprunner/v3/runner.py b/httprunner/v3/runner.py index <HASH>..<HASH> 100644 --- a/httprunner/v3/runner.py +++ b/httprunner/v3/runner.py @@ -28,7 +28,7 @@ class TestCaseRunner(object): self.config.variables.update(variables) return self - def run_step(self, step: TestStep): + def __run_step(self, step: TestStep): logger.info(f"run step: {step.name}") # parse @@ -75,7 +75,7 @@ class TestCaseRunner(object): # parse variables step.variables = parse_variables_mapping(step.variables, self.config.functions) # run step - extract_mapping = self.run_step(step) + extract_mapping = self.__run_step(step) # save extracted variables to session variables session_variables.update(extract_mapping) # save request & response meta data
refactor: make run_step as private method
HttpRunner_HttpRunner
train
py
828ef252d01e43634794ce9b6824899a98a42554
diff --git a/py/test/defaultconftest.py b/py/test/defaultconftest.py index <HASH>..<HASH> 100644 --- a/py/test/defaultconftest.py +++ b/py/test/defaultconftest.py @@ -67,15 +67,15 @@ def adddefaultoptions(config): Option('', '--traceconfig', action="store_true", dest="traceconfig", default=False, help="trace considerations of conftest.py files."), - ) - - config._addoptions('EXPERIMENTAL options', Option('-f', '--looponfailing', action="store_true", dest="looponfailing", default=False, help="loop on failing test set."), Option('', '--exec', action="store", dest="executable", default=None, help="python executable to run the tests with."), + ) + + config._addoptions('EXPERIMENTAL options', Option('-d', '--dist', action="store_true", dest="dist", default=False, help="ad-hoc distribute tests across machines (requires conftest settings)"),
[svn r<I>] looponfailing and exec are not so experimental --HG-- branch : trunk
vmalloc_dessert
train
py
0ff49512081adcdd06545c3973628cdf5ca95b64
diff --git a/src/FeedIo/Rule/Atom/LinkNode.php b/src/FeedIo/Rule/Atom/LinkNode.php index <HASH>..<HASH> 100644 --- a/src/FeedIo/Rule/Atom/LinkNode.php +++ b/src/FeedIo/Rule/Atom/LinkNode.php @@ -14,7 +14,6 @@ use FeedIo\Feed\ItemInterface; use FeedIo\Feed\NodeInterface; use FeedIo\RuleAbstract; use FeedIo\RuleSet; -use FeedIo\Rule\Media; class LinkNode extends RuleAbstract {
Use Atom-specific media class to write a compliant enclosure
alexdebril_feed-io
train
php
9158ea0d1f3b68ac4b61b45634dcfbd85f0a13ff
diff --git a/rtwilio/views.py b/rtwilio/views.py index <HASH>..<HASH> 100644 --- a/rtwilio/views.py +++ b/rtwilio/views.py @@ -58,6 +58,10 @@ class TwilioBackendView(GenericHttpBackendView): def dispatch(self, *args, **kwargs): return super(TwilioBackendView, self).dispatch(*args, **kwargs) + def form_valid(self, form): + super(TwilioBackendView, self).form_valid(form) + return HttpResponse('') + @require_POST @csrf_exempt @@ -77,6 +81,6 @@ def status_callback(request): logger.debug("callback data") logger.debug(form.cleaned_data) raise - return HttpResponse('OK') + return HttpResponse('') else: return HttpResponseBadRequest()
Don't send OK seeing this creates an error on twilio. Twilio produces the following error: Warning: <I> Schema validation warning Description: Content is not allowed in prolog.
caktus_rapidsms-twilio
train
py
46d048be1df09a3c1f3baf08f699066d38f7b067
diff --git a/lib/bolt/cli.rb b/lib/bolt/cli.rb index <HASH>..<HASH> 100644 --- a/lib/bolt/cli.rb +++ b/lib/bolt/cli.rb @@ -527,7 +527,7 @@ HELP cli << "--#{setting}" << dir end Puppet.initialize_settings(cli) - Puppet::Pal.in_tmp_environment('bolt', modulepath: [BOLTLIB_PATH] + modulepath) do |pal| + Puppet::Pal.in_tmp_environment('bolt', modulepath: [BOLTLIB_PATH] + modulepath, facts: {}) do |pal| pal.with_script_compiler do |compiler| compiler.call_function('run_plan', plan, args) end
(maint) Use empty facts when running plans This commit runs plans with empty facts instead of running facter from bolt. This cuts 2s off of most plan runs and will allow us to discover which facts if any are useful to expose to plans.
puppetlabs_bolt
train
rb
6d717790782ed31af5d1137183db17d70fb2223a
diff --git a/test/unit/integrations/universal/universal_return_test.rb b/test/unit/integrations/universal/universal_return_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/integrations/universal/universal_return_test.rb +++ b/test/unit/integrations/universal/universal_return_test.rb @@ -18,6 +18,11 @@ class UniversalReturnTest < Test::Unit::TestCase assert [email protected]? end + def test_success_after_ackowledge + assert @return.notification.acknowledge + assert @return.success? + end + private def query_data
Test success? after acknowledge on return.
activemerchant_offsite_payments
train
rb
7c52d9df25e7863bde0c92345cc270c1fc6e4f12
diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index <HASH>..<HASH> 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -195,6 +195,7 @@ class Tasks extends \Piwik\Plugin\Tasks */ public function notifyTrackingFailures() { + $this->cleanupTrackingFailures(); $failures = $this->trackingFailures->getAllFailures(); $general = Config::getInstance()->General; if (!empty($failures) && $general['enable_tracking_failures_notification']) {
Make sure to clean up tracking failures before sending email notification (#<I>) Feedback from a customer... Eg the daily `cleanupTrackingFailures()` action might be only executed after the weekly `notifyTrackingFailures` therefore we should try to clean up failures first and then check if any are left. Avoids the case where a user opens hours later the email they receive and then there are no tracking failures reported. This could still happen but it's a bit less likely.
matomo-org_matomo
train
php
2545c81ec25bdafda1dd0f60ebb49435ad06dee3
diff --git a/src/utils/menuUtils.js b/src/utils/menuUtils.js index <HASH>..<HASH> 100644 --- a/src/utils/menuUtils.js +++ b/src/utils/menuUtils.js @@ -27,8 +27,10 @@ export const EnhancedMenuItem = compose( } }), branch(({ navTo }) => navTo, withRouter) -)(function({ navTo, staticContext, ...props }) { - let clickHandler = props.onClick; +)(function({ navTo, context, staticContext, ...props }) { + let clickHandler = (...args) => { + props.onClick(...args, context); + }; if (navTo) { clickHandler = e => { if (e.metaKey || e.ctrlKey) { @@ -180,6 +182,7 @@ export const DynamicMenuItem = ({ <ItemComponent // filter out unwanted attributes here! {...omit(item, unwantedAttrs)} + context={context} icon={item.icon || item.iconName} labelElement={item.hotkey && <KeyCombo minimal combo={item.hotkey} />} text={item.text} @@ -328,7 +331,7 @@ export function showContextMenu( if (!menuDef) return; const MenuComponent = menuComp; - + event.persist(); // Render a context menu at the passed event's position ContextMenu.show( <MenuComponent
updating enhanced menu onClick to alway have the original event ctx passed as the final arg
TeselaGen_teselagen-react-components
train
js
e674255ebef135ab5dd2089a9969a68c63fa9c41
diff --git a/src/ol/deviceorientation.js b/src/ol/deviceorientation.js index <HASH>..<HASH> 100644 --- a/src/ol/deviceorientation.js +++ b/src/ol/deviceorientation.js @@ -65,11 +65,11 @@ ol.DeviceOrientationProperty = { * equivalent properties in ol.DeviceOrientation are in radians for consistency * with all other uses of angles throughout OpenLayers. * - * @see http://www.w3.org/TR/orientation-event/ - * * To get notified of device orientation changes, register a listener for the * generic `change` event on your `ol.DeviceOrientation` instance. * + * @see {@link http://www.w3.org/TR/orientation-event/} + * * @constructor * @extends {ol.Object} * @param {olx.DeviceOrientationOptions=} opt_options Options.
Fix '@see' link in src/ol/deviceorientation.js
openlayers_openlayers
train
js
a516009fec10f3107bfaca38f9126ac5c32c4f58
diff --git a/src/Phinx/Console/Command/AbstractCommand.php b/src/Phinx/Console/Command/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/src/Phinx/Console/Command/AbstractCommand.php +++ b/src/Phinx/Console/Command/AbstractCommand.php @@ -48,7 +48,7 @@ abstract class AbstractCommand extends Command */ public function bootstrap(InputInterface $input, OutputInterface $output) { - if (! $this->getConfig()) + if (!$this->getConfig()) $this->loadConfig($input, $output); $this->loadManager($output);
Fixing phpcs warnings
cakephp_phinx
train
php
f409467f6cce22c12fe679ed355c700a5f5a801e
diff --git a/hamper/Commander.py b/hamper/Commander.py index <HASH>..<HASH> 100644 --- a/hamper/Commander.py +++ b/hamper/Commander.py @@ -87,10 +87,16 @@ class OmgPonies(object): def __call__(self, commander, user, message): commander.say('OMG PONIES!!!') +@registerCommand('.*lmgtfy\s+(.*)', False) +class LetMeGoogleThatForYou(object): + def __call__(self, commander, user, message): + regex = r'.*lmgtfy\s+(.*)\s*' + match = re.match(regex, message, re.IGNORECASE).groups()[0] + commander.say('http://lmgtfy.com/?q=' + match) if __name__ == '__main__': if len(sys.argv) > 1: - chan = sys.argv + chan = sys.argv[1] else: chan = 'hamper'
add let me google that for you (lmgtfy) command
hamperbot_hamper
train
py
88287aa8fb9fcc626fce6cbe115736af95f85353
diff --git a/agent/agent.go b/agent/agent.go index <HASH>..<HASH> 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -384,7 +384,6 @@ func (a *HostAgent) startService(conn *zk.Conn, procFinished chan<- int, ssStats // config files configFiles := "" for filename, config := range service.ConfigFiles { - glog.Infof("%s: %s", filename, config) prefix := fmt.Sprintf("cp_%s_%s_", service.Id, strings.Replace(filename, "/", "__", -1)) f, err := ioutil.TempFile("", prefix) if err != nil { @@ -425,6 +424,9 @@ func (a *HostAgent) startService(conn *zk.Conn, procFinished chan<- int, ssStats glog.V(0).Infof("Starting: %s", cmdString) + a.dockerTerminate(serviceState.Id) + a.dockerRemove(serviceState.Id) + cmd := exec.Command("bash", "-c", cmdString) go a.waitForProcessToDie(conn, cmd, procFinished, serviceState)
make sure there are no service state containers already running, or dead, before running new ones
control-center_serviced
train
go
e5b8e7cc1e5a974022233d5509ebe78df8659da1
diff --git a/magellan-library/src/main/java/com/wealthfront/magellan/BaseScreenView.java b/magellan-library/src/main/java/com/wealthfront/magellan/BaseScreenView.java index <HASH>..<HASH> 100644 --- a/magellan-library/src/main/java/com/wealthfront/magellan/BaseScreenView.java +++ b/magellan-library/src/main/java/com/wealthfront/magellan/BaseScreenView.java @@ -1,7 +1,6 @@ package com.wealthfront.magellan; import android.view.View; -import android.view.ViewGroup; import android.content.Context; import android.widget.FrameLayout; @@ -26,7 +25,7 @@ public class BaseScreenView<S extends Screen> extends FrameLayout implements Scr return screen; } - public View inflate(int resource, ViewGroup root) { - return inflate(getContext(), resource, root); + public View inflate(int resource) { + return inflate(getContext(), resource, this); } }
new inflate method now only takes one parameter the root ViewGroup is now inferred to this
wealthfront_magellan
train
java
0140e54fe3c3429a9ffa57ea240143c270853c4a
diff --git a/backends/etcd/client.go b/backends/etcd/client.go index <HASH>..<HASH> 100644 --- a/backends/etcd/client.go +++ b/backends/etcd/client.go @@ -38,7 +38,7 @@ func NewEtcdClient(machines []string, cert, key string, caCert string) (*Client, func (c *Client) GetValues(keys []string) (map[string]string, error) { vars := make(map[string]string) for _, key := range keys { - resp, err := c.client.Get(key, false, true) + resp, err := c.client.Get(key, true, true) if err != nil { return vars, err }
ensure etcd keys are sorted when retrieved
kelseyhightower_confd
train
go
0907899356b8bc76b76668552dacd35d686a8400
diff --git a/client/views/datatable.js b/client/views/datatable.js index <HASH>..<HASH> 100644 --- a/client/views/datatable.js +++ b/client/views/datatable.js @@ -42,11 +42,17 @@ module.exports = ContentView.extend({ // FIXME: should listen to any active facet changes var primary = this.model.primary; - var columns = [primary.value]; + var columns = [{ + label: primary.name, + format: primary.value + }]; window.app.facets.forEach(function(f) { if (f.active && f != primary) { - columns.push(f.value); + columns.push({ + label: f.name, + format: f.value + }); } }); @@ -54,13 +60,14 @@ module.exports = ContentView.extend({ if (this.model.order == "ascending") { order = d3.ascending; } - - var dummy = function () {return 1;}; + + var value = this.model.primary.value; var chart = dc.dataTable(this.queryByHook('datatable')); chart .size(this.model.count) + .showGroups(false) .dimension(this._crossfilter.dimension) - .group(dummy) + .group(function(d) {return value(d);}) .transitionDuration(window.anim_speed) .columns(columns) .order(order)
Update datatable; FIXME: ordering of displayed rows is lexicographic should be numeric
NLeSC_spot
train
js
ab60fd841466f3f2849ed7c1d7648573a24a9578
diff --git a/lib/sync/index.js b/lib/sync/index.js index <HASH>..<HASH> 100644 --- a/lib/sync/index.js +++ b/lib/sync/index.js @@ -209,7 +209,8 @@ function start(cb) { var syncProcessorImpl = syncProcessor(syncStorage, dataHandlers, metricsClient, hashProvider); syncWorker = new Worker(syncQueue, syncProcessorImpl, metricsClient, {name: 'sync_worker'}); - ackWorker = new Worker(ackQueue, ackProcessor, metricsClient, {name: 'ack_worker'}); + var ackProcessorImpl = ackProcessor(syncStorage); + ackWorker = new Worker(ackQueue, ackProcessorImpl, metricsClient, {name: 'ack_worker'}); pendingWorker = new Worker(pendingQueue, pendingProcessor, metricsClient, {name: 'pending_worker'}); ackWorker.work(); pendingWorker.work();
update the constructor of ackProcessor
feedhenry_fh-mbaas-api
train
js
514365593142c91ac8872e32adcf145e4b58651c
diff --git a/lib/dm-core/associations/relationship.rb b/lib/dm-core/associations/relationship.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/associations/relationship.rb +++ b/lib/dm-core/associations/relationship.rb @@ -129,7 +129,9 @@ module DataMapper @query end - # TODO: document + # Returns model class used by child side of the relationship + # + # @returns [DataMapper::Resource] Class of association child # @api semipublic def child_model @child_model ||= (@parent_model || Object).find_const(@child_model_name) @@ -164,7 +166,9 @@ module DataMapper end end - # TODO: document + # Returns model class used by parent side of the relationship + # + # @returns [DataMapper::Resource] Class of association parent # @api semipublic def parent_model @parent_model ||= (@child_model || Object).find_const(@parent_model_name) @@ -172,7 +176,9 @@ module DataMapper raise NameError, "Cannot find the parent_model #{@parent_model_name} for #{@child_model || @child_model_name} in #{name}" end - # TODO: document + # Returns a set of keys that identify parent model + # + # @return [DataMapper::PropertySet] a set of properties that identify parent model # @api semipublic def parent_key @parent_key ||=
Document child_model, parent_model and parent_key for DataMapper::Associations::Relationship
datamapper_dm-core
train
rb
ab2d3871290a88a7e69bdd99088fdb305327ab36
diff --git a/test/unit/Query/SqlQuery.test.php b/test/unit/Query/SqlQuery.test.php index <HASH>..<HASH> 100644 --- a/test/unit/Query/SqlQuery.test.php +++ b/test/unit/Query/SqlQuery.test.php @@ -101,6 +101,17 @@ public function testLastInsertId( $this->assertEquals($uuid, $resultSet["name"]); } +public function testSubsequentCounts() { + $testData = Helper::queryPathExistsProvider(); + $queryPath = $testData[0][2]; + file_put_contents($queryPath, "select * from test_table"); + $query = new SqlQuery($queryPath, $this->driverSingleton()); + $resultSet = $query->execute(); + $count = count($resultSet); + $this->assertGreaterThan(0, $count); + $this->assertCount($count, $resultSet); +} + private function driverSingleton():Driver { if(is_null($this->driver)) { $settings = new Settings(
Positive failing test for #<I>.
PhpGt_Database
train
php
3b3da6ccfc4ecaa833b6e0784d4d97b899ac82ed
diff --git a/kubetest/main.go b/kubetest/main.go index <HASH>..<HASH> 100644 --- a/kubetest/main.go +++ b/kubetest/main.go @@ -545,7 +545,8 @@ func writeMetadata(path, metadataSources string) error { } ver := findVersion() - m["job-version"] = ver + m["job-version"] = ver // TODO(krzyzacy): retire + m["revision"] = ver re := regexp.MustCompile(`^BUILD_METADATA_(.+)$`) for _, e := range os.Environ() { p := strings.SplitN(e, "=", 2) diff --git a/kubetest/main_test.go b/kubetest/main_test.go index <HASH>..<HASH> 100644 --- a/kubetest/main_test.go +++ b/kubetest/main_test.go @@ -42,6 +42,11 @@ func TestWriteMetadata(t *testing.T) { version: "v1.8.0-alpha.2.251+ba2bdb1aead615", }, { + sources: nil, + key: "revision", + version: "v1.8.0-alpha.2.251+ba2bdb1aead615", + }, + { sources: map[string]mdata{"images.json": {"imgkey": "imgval"}}, key: "imgkey", version: "v1.8.0-alpha.2.251+ba2bdb1aead615",
make kubetest write version to `revision` instead of `job-version` as well
kubernetes_test-infra
train
go,go
4f4b5e6e89a1d074fbb24d7d524f3fb8db78fe0d
diff --git a/lib/beaker-docker/version.rb b/lib/beaker-docker/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-docker/version.rb +++ b/lib/beaker-docker/version.rb @@ -1,3 +1,3 @@ module BeakerDocker - VERSION = '0.0.1' + VERSION = '0.1.0' end
(GEM) update beaker-docker version to <I>
puppetlabs_beaker-docker
train
rb
0b11a88a697f00bfc924398b0d67892c3d126ffb
diff --git a/api/api.go b/api/api.go index <HASH>..<HASH> 100644 --- a/api/api.go +++ b/api/api.go @@ -251,7 +251,7 @@ func (a *API) apiCall(reqMethod string, reqPath string, data []byte) ([]byte, er reqURL += "/" } if len(reqPath) >= 3 && reqPath[:3] == "/v2" { - reqURL += reqPath[3:len(reqPath)] + reqURL += reqPath[3:] } else { reqURL += reqPath }
upd: second slice arg is redundant
circonus-labs_circonus-gometrics
train
go
4fdebd48b403ed67f0c4dd0867375012999b9d57
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -93,6 +93,10 @@ module.exports = { trees.push(vendorTree); } + if(!this.bootstrapDatepickerOptions && this.getConfig) { + this.bootstrapDatepickerOptions = this.getConfig(); + } + var bootstrapDatepickerPath = this.bootstrapDatepickerOptions.path; var datePickerJsTree = new Funnel(bootstrapDatepickerPath, { destDir: 'bootstrap-datepicker',
Check for init option on treeForVendor (#<I>) * Fix for ember-cli on <I> calling treeForVendor twice, but not the config.
topaxi_ember-bootstrap-datepicker
train
js
8dbd5a9b215622e3f2cbfb0b43b1e34d923f2797
diff --git a/lib/homesick.rb b/lib/homesick.rb index <HASH>..<HASH> 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -43,6 +43,19 @@ class Homesick < Thor git_submodule_update end end + + homesickrc = destination.join('.homesickrc').expand_path + if homesickrc.exist? + proceed = shell.yes?("#{uri} has a .homesickrc. Proceed with evaling it? (This could be destructive)") + if proceed + shell.say_status "eval", homesickrc + inside destination do + eval homesickrc.read, binding, homesickrc.expand_path + end + else + shell.say_status "eval skip", "not evaling #{homesickrc}, #{destination} may need manual configuration", :blue + end + end end end
Spiked homesickrc support. Create a .homesickrc in a castle, and you will be prompted to eval it at clone. Runs in castle directory, and runs in the context of a Homesick instance
technicalpickles_homesick
train
rb
c9dc174187c87f00eb7359ff50cde8a4df968ae9
diff --git a/lxd/storage/drivers/driver_lvm_volumes.go b/lxd/storage/drivers/driver_lvm_volumes.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/driver_lvm_volumes.go +++ b/lxd/storage/drivers/driver_lvm_volumes.go @@ -18,6 +18,7 @@ import ( "github.com/lxc/lxd/lxd/revert" "github.com/lxc/lxd/lxd/rsync" "github.com/lxc/lxd/shared" + "github.com/lxc/lxd/shared/instancewriter" log "github.com/lxc/lxd/shared/log15" ) @@ -529,8 +530,8 @@ func (d *lvm) MigrateVolume(vol Volume, conn io.ReadWriteCloser, volSrcArgs *mig // BackupVolume copies a volume (and optionally its snapshots) to a specified target path. // This driver does not support optimized backups. -func (d *lvm) BackupVolume(vol Volume, targetPath string, _, snapshots bool, op *operations.Operation) error { - return genericVFSBackupVolume(d, vol, targetPath, snapshots, op) +func (d *lvm) BackupVolume(vol Volume, tarWriter *instancewriter.InstanceTarWriter, _, snapshots bool, op *operations.Operation) error { + return genericVFSBackupVolume(d, vol, tarWriter, snapshots, op) } // CreateVolumeSnapshot creates a snapshot of a volume.
lxd/storage/drivers/driver/lvm/volumes: Adds tarWriter arg to BackupVolume
lxc_lxd
train
go
31da89c23988fb6d62014247b6f036920f07efb3
diff --git a/cumulus/settings.py b/cumulus/settings.py index <HASH>..<HASH> 100644 --- a/cumulus/settings.py +++ b/cumulus/settings.py @@ -27,7 +27,7 @@ CUMULUS = { "HEADERS": {}, "GZIP_CONTENT_TYPES": [], "USE_PYRAX": True, - "PYRAX_IDENTITY_TYPE": None, + "PYRAX_IDENTITY_TYPE": 'rackspace', "FILE_TTL": None } diff --git a/example/settings/test.py b/example/settings/test.py index <HASH>..<HASH> 100644 --- a/example/settings/test.py +++ b/example/settings/test.py @@ -3,3 +3,5 @@ from common import * # noqa INSTALLED_APPS += ( 'cumulus.tests', ) + +CUMULUS["PYRAX_IDENTITY_TYPE"] = 'rackspace'
Default to rackspace identity in tests
django-cumulus_django-cumulus
train
py,py
1d556c230acd41ed2753460fcb29018092c7ffda
diff --git a/analytics.go b/analytics.go index <HASH>..<HASH> 100644 --- a/analytics.go +++ b/analytics.go @@ -10,16 +10,16 @@ import "time" import "log" // Version of the client. -var version = "2.0.0" +const Version = "2.0.0" // Endpoint for the Segment API. -var Endpoint = "https://api.segment.io" +const Endpoint = "https://api.segment.io" // DefaultContext of message batches. var DefaultContext = map[string]interface{}{ "library": map[string]interface{}{ "name": "analytics-go", - "version": version, + "version": Version, }, } @@ -243,7 +243,7 @@ func (c *Client) send(msgs []interface{}) { return } - req.Header.Add("User-Agent", "analytics-go (version: "+version+")") + req.Header.Add("User-Agent", "analytics-go (version: "+Version+")") req.Header.Add("Content-Type", "application/json") req.Header.Add("Content-Length", string(len(b))) req.SetBasicAuth(c.key, "")
Make version a constant and export it
segmentio_analytics-go
train
go
8e971131fdf1222e50c7a91edaf958e084946bd9
diff --git a/lightadmin-core/src/main/java/org/lightadmin/core/config/LightAdminWebApplicationInitializer.java b/lightadmin-core/src/main/java/org/lightadmin/core/config/LightAdminWebApplicationInitializer.java index <HASH>..<HASH> 100644 --- a/lightadmin-core/src/main/java/org/lightadmin/core/config/LightAdminWebApplicationInitializer.java +++ b/lightadmin-core/src/main/java/org/lightadmin/core/config/LightAdminWebApplicationInitializer.java @@ -82,6 +82,7 @@ public class LightAdminWebApplicationInitializer implements WebApplicationInitia resourceServlet.setAllowedResources("/WEB-INF/admin/**/*.jsp"); resourceServlet.setApplyLastModified(true); resourceServlet.setContentType("text/html"); + ServletRegistration.Dynamic customResourceServletRegistration = servletContext.addServlet(LIGHT_ADMIN_CUSTOM_RESOURCE_SERVLET_NAME, resourceServlet); customResourceServletRegistration.setLoadOnStartup(2); customResourceServletRegistration.addMapping(customResourceServletMapping(servletContext));
Sidebars fragments async loading.
la-team_light-admin
train
java
f557e68210c38d978dca8cac2730bab4741b04de
diff --git a/src/widgets/LoginForm.php b/src/widgets/LoginForm.php index <HASH>..<HASH> 100644 --- a/src/widgets/LoginForm.php +++ b/src/widgets/LoginForm.php @@ -19,6 +19,7 @@ use Yii; class LoginForm extends \yii\base\Widget { public $model; + public $captcha = false; public $options = []; public $shows = [];
created captcha field in LoginForm
hiqdev_yii2-thememanager
train
php
415aefd28280e4166848b8cb9cd4d14f460a4e8f
diff --git a/api/request.go b/api/request.go index <HASH>..<HASH> 100644 --- a/api/request.go +++ b/api/request.go @@ -47,6 +47,9 @@ func (source *Source) parse(ctx context.Context) (*txbuilder.Source, error) { source.TxHashAsID = nil switch source.Type { case "account", "": + if source.AccountID == "" { + return nil, errors.WithDetail(ErrBadBuildRequest, "no account specified on input") + } if source.AssetID == nil { return nil, errors.WithDetail(ErrBadBuildRequest, "asset type unspecified") } @@ -143,6 +146,9 @@ func (dest Destination) parse(ctx context.Context) (*txbuilder.Destination, erro switch dest.Type { case "account", "": + if dest.AccountID == "" { + return nil, errors.WithDetail(ErrBadBuildRequest, "no account specified on output") + } return asset.NewAccountDestination(ctx, assetAmount, dest.AccountID, dest.Metadata) case "address": return txbuilder.NewScriptDestination(ctx, assetAmount, dest.Address, dest.Metadata), nil
api: add missing account id error to build request This enables the error returned to the client to be more specific than "account not found" or "insufficient funds." Closes chain/chainprv#<I>. Reviewers: @kr
chain_chain
train
go
82f32d5c02d2f94c6b30d32c9157e6f792527a29
diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -108,11 +108,10 @@ module Jekyll # # Returns this configuration, overridden by the values in the file def read_config_file(file) - configuration = clone next_config = YAML.safe_load_file(file) raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash) Jekyll::Logger.info "Configuration file:", file - configuration.deep_merge(next_config) + next_config end # Public: Read in a list of configuration files and merge with this hash @@ -126,7 +125,8 @@ module Jekyll begin files.each do |config_file| - configuration = read_config_file(config_file) + new_config = read_config_file(config_file) + configuration = configuration.deep_merge(new_config) end rescue SystemCallError # Errno:ENOENT = file not found
Merge configuration properly. Closes #<I>.
jekyll_jekyll
train
rb
99d8d4224f27468ad78e2b15d118455699e6c517
diff --git a/src/View/Form/EntityContext.php b/src/View/Form/EntityContext.php index <HASH>..<HASH> 100644 --- a/src/View/Form/EntityContext.php +++ b/src/View/Form/EntityContext.php @@ -271,7 +271,7 @@ class EntityContext implements ContextInterface { } $entity = $next; } - throw \RuntimeException(sprintf( + throw new \RuntimeException(sprintf( 'Unable to fetch property "%s"', implode(".", $path) ));
Add missing new. Fixes #<I>
cakephp_cakephp
train
php
eda2208d20b542e879f8d4536c49165b5445ef4d
diff --git a/pmxbot/commands.py b/pmxbot/commands.py index <HASH>..<HASH> 100644 --- a/pmxbot/commands.py +++ b/pmxbot/commands.py @@ -572,7 +572,7 @@ def chain(client, event, channel, nick, rest): chainee = "someone nearby" if chainee == 'cperry': tmpl = "/me ties the chains extra tight around {chainee}" - elif random.randint(1, 10) != 1: + elif random.random() < .9: tmpl = ( "/me chains {chainee} to the nearest desk. " "you ain't going home, buddy."
Use random for clearer purpose (reflects <I>% probability).
yougov_pmxbot
train
py
13d36d932f894b88596e8c3c7884cda530f17d98
diff --git a/lib/sidekiq_unique_jobs/version.rb b/lib/sidekiq_unique_jobs/version.rb index <HASH>..<HASH> 100644 --- a/lib/sidekiq_unique_jobs/version.rb +++ b/lib/sidekiq_unique_jobs/version.rb @@ -3,5 +3,5 @@ module SidekiqUniqueJobs # # @return [String] the current SidekiqUniqueJobs version - VERSION = "7.0.5" + VERSION = "7.0.6" end
Bump sidekiq-unique-jobs to <I>
mhenrixon_sidekiq-unique-jobs
train
rb
3be2fc73c244ba8229364bc5da67303988cc6a37
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -1,6 +1,13 @@ var assert = require('.') var test = require('tape') +var methods = { + 'notEqual': [true, false], + 'notOk': [false], + 'equal': [true, true], + 'ok': [true] +} + test('test', function (t) { try { assert(true === true) // test that it doesn't throw @@ -23,5 +30,15 @@ test('test', function (t) { t.equal(e.message, 'hello world', 'custom message') } + Object.keys(methods).forEach(function (method) { + var args = methods[method] + try { + assert[method].apply(null, args) + t.pass('does not throw') + } catch (e) { + t.fail() + } + }) + t.end() })
adds tests for every method of the assert object <I>% code coverage 🎉
emilbayes_nanoassert
train
js
fd216532f0c4b5a1d8b123c0a4b9cf1d7a96bf61
diff --git a/experiments/utils.py b/experiments/utils.py index <HASH>..<HASH> 100644 --- a/experiments/utils.py +++ b/experiments/utils.py @@ -185,8 +185,6 @@ class WebUser(object): for enrollment in enrollments: # Looks up by PK so no point caching. if self._should_increment(enrollment.experiment): self._increment_goal_count(enrollment.experiment, enrollment.alternative, goal_name) - enrollment.goals.append(goal_name) - enrollment.save() return # If confirmed human if self._is_verified_human(): @@ -196,9 +194,6 @@ class WebUser(object): for experiment_name, (alternative, goals) in enrollments.items(): if self._should_increment(experiment_manager[experiment_name]): self._increment_goal_count(experiment_manager[experiment_name], alternative, goal_name) - goals.append(goal_name) - - self.session['experiments_enrollments'] = enrollments return else: # TODO: store temp goals and convert later when is_human is triggered
Don't record goals in db/session
mixcloud_django-experiments
train
py
500479e14bb0529b6f444425069fc738111b21db
diff --git a/bugzilla/_cli.py b/bugzilla/_cli.py index <HASH>..<HASH> 100755 --- a/bugzilla/_cli.py +++ b/bugzilla/_cli.py @@ -1040,6 +1040,10 @@ def _handle_login(opt, action, bz): if use_key: bz.interactive_save_api_key() elif do_interactive_login: + if bz.api_key: + print("You already have an API key configured for %s" % bz.url) + print("There is no need to cache a login token. Exiting.") + sys.exit(0) print("Logging into %s" % urlparse(bz.url)[1]) bz.interactive_login(username, password, restrict_login=opt.restrict_login) diff --git a/tests/test_cli_login.py b/tests/test_cli_login.py index <HASH>..<HASH> 100644 --- a/tests/test_cli_login.py +++ b/tests/test_cli_login.py @@ -100,3 +100,9 @@ def test_interactive_login(monkeypatch, run_cli): assert tmp.name in out tests.utils.diff_compare(open(tmp.name).read(), "data/clioutput/test_interactive_login_apikey_rcfile.txt") + + # Check that we don't attempt to log in if API key is configured + assert bz.api_key + cmd = "bugzilla login" + out = run_cli(cmd, bz) + assert "already have an API" in out
cli: If 'login' called but we have an API key, print and exit Otherwise the API throws an unfriendly error
python-bugzilla_python-bugzilla
train
py,py
881199a2575531a3a5417131eb9fa06c11aad8b9
diff --git a/lib/webpack/createBaseConfig.js b/lib/webpack/createBaseConfig.js index <HASH>..<HASH> 100644 --- a/lib/webpack/createBaseConfig.js +++ b/lib/webpack/createBaseConfig.js @@ -212,6 +212,7 @@ module.exports = function createBaseConfig ({ } createCSSRule('css', /\.css$/) + createCSSRule('postcss', /\.p(ost)?css$/) createCSSRule('scss', /\.scss$/, 'sass-loader', siteConfig.scss) createCSSRule('sass', /\.sass$/, 'sass-loader', Object.assign({ indentedSyntax: true }, siteConfig.sass)) createCSSRule('less', /\.less$/, 'less-loader', siteConfig.less)
feat: support style lang postcss (close: #<I>)
vuejs_vuepress
train
js
9eba179f2b081353ce6a8d80cddca493b8ddeefc
diff --git a/tests/constants.py b/tests/constants.py index <HASH>..<HASH> 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -20,6 +20,7 @@ DOCKERFILE_OK_PATH = os.path.join(os.path.dirname(__file__), 'files', 'docker-he DOCKERFILE_ERROR_BUILD_PATH =\ os.path.join(os.path.dirname(__file__), 'files', 'docker-hello-world-error-build') DOCKERFILE_SUBDIR_PATH = os.path.join(os.path.dirname(__file__), 'files', 'df-in-subdir') +DOCKERFILE_SHA1 = "6e592f1420efcd331cd28b360a7e02f669caf540" REGISTRY_PORT = "5000" DOCKER0_IP = "172.17.42.1"
util,clone: git can't clone with `-b $SHA1` Resolves #<I>
projectatomic_atomic-reactor
train
py
2d4138cfd516554f7715874430fb5a39a0d458c3
diff --git a/Service/ClientProvider.php b/Service/ClientProvider.php index <HASH>..<HASH> 100644 --- a/Service/ClientProvider.php +++ b/Service/ClientProvider.php @@ -82,16 +82,14 @@ class ClientProvider // This will allow us to refresh the token $client->setAccessType('offline'); - if (!empty($tokenName)) { - $accessToken = $this->getAccessToken($tokenName); + $accessToken = $this->getAccessToken($tokenName); + if ($accessToken) { + $client->setAccessToken((string) $accessToken); - if ($accessToken) { - $client->setAccessToken((string) $accessToken); - - $this->refreshToken($client); - } + $this->refreshToken($client); } + return $client; }
You should always try to get access token
Happyr_GoogleSiteAuthenticatorBundle
train
php
80a3f35912e47e89f529cb40362b920aef832229
diff --git a/tests/test_call_hooks.py b/tests/test_call_hooks.py index <HASH>..<HASH> 100644 --- a/tests/test_call_hooks.py +++ b/tests/test_call_hooks.py @@ -177,4 +177,5 @@ def test_setup_py(): hooks = get_hooks('setup-py') with modified_env({'PYTHONPATH': BUILDSYS_PKGS}): res = hooks.get_requires_for_build_wheel({}) + res = [x for x in res if x != 'setuptools'] assert res == ['wheel']
Fix test fail with some versions of setuptools get_requires_for_build_wheel() sometimes returns ['setuptools', 'wheel'] and other times it returns ['wheel'] This is probably dependent on the version of setuptools See <URL>
pypa_pep517
train
py
4d62da4c9d1989a2ea54b0b4428dfa0bf22293b2
diff --git a/pysolr.py b/pysolr.py index <HASH>..<HASH> 100644 --- a/pysolr.py +++ b/pysolr.py @@ -168,7 +168,7 @@ except NameError: __author__ = 'Joseph Kocherhans, Jacob Kaplan-Moss, Daniel Lindsley' __all__ = ['Solr'] -__version__ = (2, 0, 15, 'beta') +__version__ = (2, 0, 15) def get_version(): return "%s.%s.%s" % __version__[:3] 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 = "pysolr", - version = "2.0.15-beta", + version = "2.0.15", description = "Lightweight python wrapper for Apache Solr.", author = 'Daniel Lindsley', author_email = '[email protected]', @@ -16,4 +16,4 @@ setup( 'Topic :: Internet :: WWW/HTTP :: Indexing/Search' ], url = 'http://github.com/toastdriven/pysolr/' -) \ No newline at end of file +)
Bumped to <I>!
django-haystack_pysolr
train
py,py
98c95ba8722fe11bfa6459e0e5caa65eb7c0dcdb
diff --git a/cassiopeia/data.py b/cassiopeia/data.py index <HASH>..<HASH> 100644 --- a/cassiopeia/data.py +++ b/cassiopeia/data.py @@ -213,6 +213,8 @@ class Division(Enum): class Rank: def __init__(self, tier: Tier, division: Division): self.tuple = (tier, division) + self.tier = tier + self.division = division def __str__(self): return "<{} {}>".format(self.tuple[0], self.tuple[1])
added rank.tier and rank.division
meraki-analytics_cassiopeia
train
py
1ead2e4fea5cc49440676d2620b17a5b002b4604
diff --git a/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/propertywindow.js b/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/propertywindow.js index <HASH>..<HASH> 100644 --- a/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/propertywindow.js +++ b/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/propertywindow.js @@ -5321,6 +5321,8 @@ Ext.form.NameTypeEditor = Ext.extend(Ext.form.TriggerField, { var gridPanel = new Ext.Panel({ layout: 'fit', + autoScroll: true, + overflowY: 'scroll', viewConfig : { forceFit:true },
JBPM-<I> - Editor for variable definition has no scrollbar (#<I>)
kiegroup_jbpm-designer
train
js
35e9d297a204643810a9da95a7045be645e7820a
diff --git a/components/list/list.js b/components/list/list.js index <HASH>..<HASH> 100644 --- a/components/list/list.js +++ b/components/list/list.js @@ -419,7 +419,9 @@ export default class List extends Component { }; getFirst() { - return this.props.data.find(item => item.rgItemType === Type.ITEM); + return this.props.data.find( + item => item.rgItemType === Type.ITEM || item.rgItemType === Type.CUSTOM + ); } getSelected() {
List `getFirst` method doesn't return the first element of a custom type #RG-<I> fix [publish] (cherry picked from commit <I>b<I>be)
JetBrains_ring-ui
train
js
84de3517208674e4778aeed6ef4a16a79ef14af7
diff --git a/plivo/rest/base_client.py b/plivo/rest/base_client.py index <HASH>..<HASH> 100644 --- a/plivo/rest/base_client.py +++ b/plivo/rest/base_client.py @@ -18,7 +18,7 @@ from requests import Request, Session AuthenticationCredentials = namedtuple('AuthenticationCredentials', 'auth_id auth_token') -PLIVO_API = 'https://apidev.sms.plivodev.com' +PLIVO_API = 'https://api.plivo.com' PLIVO_API_BASE_URI = '/'.join([PLIVO_API, 'v1/Account']) diff --git a/plivo/rest/client.py b/plivo/rest/client.py index <HASH>..<HASH> 100644 --- a/plivo/rest/client.py +++ b/plivo/rest/client.py @@ -23,7 +23,7 @@ from requests import Request, Session AuthenticationCredentials = namedtuple('AuthenticationCredentials', 'auth_id auth_token') -PLIVO_API = 'https://apidev.sms.plivodev.com' +PLIVO_API = 'https://api.plivo.com' PLIVO_API_BASE_URI = '/'.join([PLIVO_API, 'v1/Account'])
api url changed to prod
plivo_plivo-python
train
py,py
d220f7f455e870f39c2cc4f447df74dc6edd3b71
diff --git a/webextension/scripts/injected/checkalts.js b/webextension/scripts/injected/checkalts.js index <HASH>..<HASH> 100644 --- a/webextension/scripts/injected/checkalts.js +++ b/webextension/scripts/injected/checkalts.js @@ -1,3 +1,6 @@ +// isolation +(function () { + var a11ycss = a11ycss || {}; a11ycss.checkalts = { @@ -171,3 +174,6 @@ browser.runtime.onMessage.addListener((message) => { a11ycss.checkalts.updatePictos(message.icons); } }); + +})(); +// end isolation \ No newline at end of file
webext: isolation in injected code
ffoodd_a11y.css
train
js
1c70cf5737706a65ab1e6d72f2d2578356cd3110
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -49,12 +49,29 @@ function testStackForMatch(stack, method, path) { } if (subStack) { - var trimmedPath = layer.path && path.substr(layer.path.length) || path; + // Trim any `.use()` prefix. + if (layer.path) { + path = trimPrefix(path, layer.path); + } // Recurse into nested apps/routers. - return testStackForMatch(subStack, method, trimmedPath); + return testStackForMatch(subStack, method, path); } return false; }); } + +function trimPrefix(path, prefix) { + var charAfterPrefix = path.charAt(prefix.length); + + if (charAfterPrefix === '/' || charAfterPrefix === '.') { + path = path.substring(prefix.length); + + if (path.charAt(0) !== '/') { + path = '/' + path; + } + } + + return path; +}
Trim path prefixes more like Express Express trims `.use()` mount paths, so this updates to trimming paths in a similar manner to: <URL>
ericf_express-slash
train
js
bdbda3213bc5c540c507091017538af34ed32b55
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -161,8 +161,12 @@ Handler.prototype.getView = function(req, cb) { if (h.viewHtml) return cb(); var loader = /https?:/.test(h.viewUrl) ? h.loadRemote : h.loadLocal; loader.call(h, h.viewUrl, function(err, body) { - if (body) h.viewHtml = body; - else err = new Error("Empty initial html in " + h.viewUrl); + if (body) { + h.viewHtml = body; + h.mtime = Date.now(); + } else { + err = new Error("Empty initial html in " + h.viewUrl); + } cb(err); }); };
Set handler mtime to be view mtime
kapouer_express-dom
train
js
380a87c6f4ce5136da3dbeab117f790e1831a444
diff --git a/src/api/player.js b/src/api/player.js index <HASH>..<HASH> 100644 --- a/src/api/player.js +++ b/src/api/player.js @@ -50,7 +50,7 @@ function Player(selector, contentInfo) { // Other public attributes this.currentTime = 0; this.duration = 0; - this.volume = 1; + this.volume = contentInfo.volume != undefined ? contentInfo.volume : 1; if (Util.isIOS()) { this.injectFullscreenStylesheet_(); @@ -104,6 +104,7 @@ Player.prototype.setContent = function(contentInfo) { * Sets the software volume of the video. 0 is mute, 1 is max. */ Player.prototype.setVolume = function(volumeLevel) { + this.volume = volumeLevel; var data = { volumeLevel: volumeLevel }; @@ -173,6 +174,7 @@ Player.prototype.onMessage_ = function(event) { switch (type) { case 'ready': + this.setVolume(this.volume); case 'modechange': case 'error': case 'click':
Add volume setting in the video player's initial configuration
googlearchive_vrview
train
js
7d0fc06a6bca07222d8fb440c788b094a4bbb003
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open('requirements.txt', 'r') as f: setuptools.setup( name="etk", - version="2.1.7", + version="2.1.8", author="Amandeep Singh", author_email="[email protected]", description="extraction toolkit",
update setup.py for version number
usc-isi-i2_etk
train
py