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
6c134ab7254d2eb829ef3a35b3f56166e99f34b8
diff --git a/falafel/__init__.py b/falafel/__init__.py index <HASH>..<HASH> 100644 --- a/falafel/__init__.py +++ b/falafel/__init__.py @@ -1,7 +1,7 @@ import os __here__ = os.path.dirname(os.path.abspath(__file__)) -VERSION = "1.8.0" +VERSION = "1.9.0" NAME = "falafel" with open(os.path.join(__here__, "RELEASE")) as f:
Bumping version to <I>
RedHatInsights_insights-core
train
py
eb6948aab30995bf9b8c42899f0858f97f2534e8
diff --git a/carrot/serialization.py b/carrot/serialization.py index <HASH>..<HASH> 100644 --- a/carrot/serialization.py +++ b/carrot/serialization.py @@ -124,7 +124,7 @@ class SerializerRegistry(object): # For unicode objects, force it into a string if not serializer and isinstance(data, unicode): - payload = data.encode(content_encoding) + payload = data.encode("utf-8") return "text/plain", "utf-8", payload if serializer:
Specifying utf-8 as the content type when forcing unicode into a string. This removes the reference to the unbound content_type variable.
ask_carrot
train
py
c7b2bd60589f23eb157c4a6117fbed6e120fc4cd
diff --git a/lib/services/api/messages.rb b/lib/services/api/messages.rb index <HASH>..<HASH> 100644 --- a/lib/services/api/messages.rb +++ b/lib/services/api/messages.rb @@ -92,19 +92,16 @@ module VCAP end class GatewayProvisionRequest < JsonMessage - required :label, SERVICE_LABEL_REGEX - required :name, String - required :plan, String - required :email, String - required :version, String - - optional :provider, String - - optional :plan_option - + required :unique_id, String + required :name, String + required :email, String + + optional :provider, String + optional :label, String + optional :plan, String + optional :version, String optional :organization_guid, String - optional :space_guid, String - optional :unique_id, String + optional :space_guid, String end # Provision and bind response use the same format
Prepare to remove GatewayProvisionRequest fields :label and :plan are going away. To do this without breaking we make them optional first and require :unique_id which takes their place. We'll make all the codes work with this, never populating :label and :plan, get that deployed, then come along and delete the fields much later when nobody uses them. [#<I>]
cloudfoundry_vcap-common
train
rb
cf47083743f456921857992b221071f98c30f90a
diff --git a/lib/rester/middleware/correlation_id.rb b/lib/rester/middleware/correlation_id.rb index <HASH>..<HASH> 100644 --- a/lib/rester/middleware/correlation_id.rb +++ b/lib/rester/middleware/correlation_id.rb @@ -6,10 +6,10 @@ module Rester # responding. class CorrelationId < Base def call(env) - Rester.correlation_id = env['X-Rester-Correlation-ID'] - super.tap { |response| - Rester.correlation_id = nil - } + Rester.correlation_id = env['HTTP_X_RESTER_CORRELATION_ID'] + super + ensure + Rester.correlation_id = nil end end # CorrelationId end # Middleware
[#<I>] Improve correlation id middleware
payout_rester
train
rb
9c35385c4c8a0ce35885fcf8442abe873493d399
diff --git a/rst2rst/tests/test_fixtures.py b/rst2rst/tests/test_fixtures.py index <HASH>..<HASH> 100644 --- a/rst2rst/tests/test_fixtures.py +++ b/rst2rst/tests/test_fixtures.py @@ -72,13 +72,12 @@ class WriterTestCase(TestCase): if real_output != theoric_output: theoric_output = theoric_output.replace('\n', '\\n\n') real_output = real_output.replace('\n', '\\n\n') - diff = [] + real_output_lines = real_output.splitlines(True) theoric_output_lines = theoric_output.splitlines(True) - for line in unified_diff(real_output_lines, - theoric_output_lines): - diff.append(line) - diff = ''.join(diff) + + diff = ''.join(unified_diff(real_output_lines, + theoric_output_lines)) msg = "Content generated from %s differs from content at %s" \ "\nDiff:\n%s" % ( input_filename,
Avoid intermediate list for unified_diff results
benoitbryon_rst2rst
train
py
0993d468a1d8699fdd9ca821f0062635d934d6c9
diff --git a/pywbem/mof_compiler.py b/pywbem/mof_compiler.py index <HASH>..<HASH> 100755 --- a/pywbem/mof_compiler.py +++ b/pywbem/mof_compiler.py @@ -30,8 +30,10 @@ """pywbem MOF Compiler Rules and implementation definition for lex and yacc. This compiler implementation is based on the PLY python package. - Today PLY is directly copied into pywbem rather than using the - separate python ply package and it is version 3.0 of PLY. + This module contains yacc and lex rules in docstrings of its + functions. The formatting of these docstrings is critical in that + it defines the parser functionality. Changing the strings or + even the formatting breaks the ply rule generation. """ @@ -40,7 +42,9 @@ import os from getpass import getpass import six -from . import lex, yacc, cim_obj +from . import cim_obj +from ply import yacc, lex + from .cim_obj import CIMInstance, CIMInstanceName, CIMClass, \ CIMProperty, CIMMethod, CIMParameter, \ CIMQualifier, CIMQualifierDeclaration, NocaseDict
The fixes for mof_compiler for ply
pywbem_pywbem
train
py
d0227b3374426a0fbe77b3683ae2dcb8f3e6d099
diff --git a/proxy-controls.js b/proxy-controls.js index <HASH>..<HASH> 100644 --- a/proxy-controls.js +++ b/proxy-controls.js @@ -83,6 +83,7 @@ module.exports = { url: data.proxyUrl + '/socketpeer/' }); + this.el.emit('proxycontrols.paircode', {pairCode: pairCode}); this.createOverlay(pairCode); peer.on('connect', this.onConnection.bind(this));
Emit event w/ pair code.
donmccurdy_aframe-proxy-controls
train
js
94df6979fb449ee10036dc74620ea9fb0121b3c4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,8 @@ here = Path(__file__).resolve().parent def read(*parts): - return codecs.open(os.path.join(here, *parts), 'r', encoding="UTF-8").read() + # convert `here` to string for Python versions before 3.6 + return codecs.open(os.path.join(str(here), *parts), 'r', encoding="UTF-8").read() def find_meta(*meta_file_parts, meta_key):
convert paths to strings for Python < <I>
MinchinWeb_minchin.text
train
py
50fefc21d5923d16eefe641371e3e3f6f2b10975
diff --git a/src/main/java/com/googlecode/lanterna/gui2/AbstractListBox.java b/src/main/java/com/googlecode/lanterna/gui2/AbstractListBox.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/gui2/AbstractListBox.java +++ b/src/main/java/com/googlecode/lanterna/gui2/AbstractListBox.java @@ -163,6 +163,10 @@ public abstract class AbstractListBox<T extends AbstractListBox<T>> extends Abst return items.get(index); } + public boolean isEmpty() { + return getItemCount() == 0; + } + public synchronized int getItemCount() { return items.size(); }
Method to test if the list box contains no items
mabe02_lanterna
train
java
8853d698ab11ca1b5f9cc7ca69fe0e76eb2a365d
diff --git a/reana_db/version.py b/reana_db/version.py index <HASH>..<HASH> 100644 --- a/reana_db/version.py +++ b/reana_db/version.py @@ -14,4 +14,4 @@ and parsed by ``setup.py``. from __future__ import absolute_import, print_function -__version__ = "0.8.0a21" +__version__ = "0.8.0a22"
release: <I>a<I>
reanahub_reana-db
train
py
e5036d13906489d9d71c514ae5c7689fd3206ca9
diff --git a/lib/slim/parser.rb b/lib/slim/parser.rb index <HASH>..<HASH> 100644 --- a/lib/slim/parser.rb +++ b/lib/slim/parser.rb @@ -207,8 +207,9 @@ module Slim when ?! # Found a directive (currently only used for doctypes) current << [:slim, :directive, line[1..-1].strip] - when ?/ + when ?/, ?{, ?[ # Found a comment. Do nothing + # '{' '[' for Hash and Array else # Found a HTML tag. insert_newline = false @@ -219,7 +220,10 @@ module Slim # Add a newline (to the generated code). We use stacks.last instead of # current because something might have been pushed to stacks. - stacks.last << [:newline] + # If '\' at the end of a line, it indicate the continuation of a statement. + unless line[-1] == ?\\ + stacks.last << [:newline] + end end result
If '\' at the end of a line, it indicate the continuation of a statement
slim-template_slim
train
rb
b6fe577f6ba881dd3534a2bd31ad0a045927a9ff
diff --git a/resemble.js b/resemble.js index <HASH>..<HASH> 100644 --- a/resemble.js +++ b/resemble.js @@ -131,6 +131,9 @@ URL: https://github.com/Huddle/Resemble.js if (typeof fileData === 'string') { hiddenImage.src = fileData; + if (hiddenImage.complete) { + hiddenImage.onload(); + } } else if (typeof fileData.data !== 'undefined' && typeof fileData.width === 'number' && typeof fileData.height === 'number') {
Call hiddenImage.onload if image is cached.
rsmbl_Resemble.js
train
js
16aa17c1b85f6306ff773e62b9f585ed6d485aa3
diff --git a/app/models/filter.rb b/app/models/filter.rb index <HASH>..<HASH> 100644 --- a/app/models/filter.rb +++ b/app/models/filter.rb @@ -23,7 +23,7 @@ class Filter < ActiveRecord::Base def self.applicable(repo) query = %{filters.id in (select filter_id from filters_repositories where repository_id = #{repo.id}) - OR filters.id in (select filter_id from filters_products where product_id = #{repo.product.id}) } + OR filters.id in (select filter_id from filters_products where product_id = #{repo.product_id}) } where(query).uniq end diff --git a/app/models/repository.rb b/app/models/repository.rb index <HASH>..<HASH> 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -49,6 +49,10 @@ class Repository < ActiveRecord::Base self.environment_product.product end + def product_id + self.environment_product.product_id + end + def environment self.environment_product.environment end
Minor tweak to repository object to just return product_id
Katello_katello
train
rb,rb
81f82cadfeb482b5e30612fc155d9bd796c5f44f
diff --git a/spec/active/active_record/manually_dated_spec.rb b/spec/active/active_record/manually_dated_spec.rb index <HASH>..<HASH> 100644 --- a/spec/active/active_record/manually_dated_spec.rb +++ b/spec/active/active_record/manually_dated_spec.rb @@ -139,9 +139,15 @@ describe Hoodoo::ActiveRecord::ManuallyDated do end context '#manual_dating_enabled?' do + class RSpecNotManuallyDated < Hoodoo::ActiveRecord::Base; end + it 'says it is manually dated' do expect( RSpecModelManualDateTest.manual_dating_enabled? ).to eq( true ) end + + it 'knows when something is not automatically dated' do + expect( RSpecNotManuallyDated.manual_dating_enabled? ).to eq( false ) + end end context '#manually_dated_at' do
Add equivalent test coverage for 'manual_dating_enabled?'
LoyaltyNZ_hoodoo
train
rb
af0087c8ddd98cb313346a6942bab9540a0b9cbc
diff --git a/lib/gush/workflow.rb b/lib/gush/workflow.rb index <HASH>..<HASH> 100644 --- a/lib/gush/workflow.rb +++ b/lib/gush/workflow.rb @@ -25,6 +25,14 @@ module Gush flow end + def continue + client = Gush::Client.new + failed_jobs = jobs.select(&:failed?) + + failed_jobs.each do |job| + client.enqueue_job(id, job) + end + end def save persist! diff --git a/spec/gush/workflow_spec.rb b/spec/gush/workflow_spec.rb index <HASH>..<HASH> 100644 --- a/spec/gush/workflow_spec.rb +++ b/spec/gush/workflow_spec.rb @@ -55,6 +55,20 @@ describe Gush::Workflow do end end + describe "#continue" do + it "enqueues failed jobs" do + flow = TestWorkflow.create + flow.find_job('Prepare').fail! + + expect(flow.jobs.select(&:failed?)).not_to be_empty + + flow.continue + + expect(flow.jobs.select(&:failed?)).to be_empty + expect(flow.find_job('Prepare').failed_at).to be_nil + end + end + describe "#mark_as_stopped" do it "marks workflow as stopped" do expect{ subject.mark_as_stopped }.to change{subject.stopped?}.from(false).to(true)
Implements #continue method Method is used to restart all failed jobs within workflow.
chaps-io_gush
train
rb,rb
e5db6c8c802851d4049d8006bc6b251bb369dc72
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -36,6 +36,10 @@ class Configuration implements ConfigurationInterface ->arrayNode('validations') ->isRequired() ->cannotBeEmpty() + ->beforeNormalization() + ->ifString() + ->then(function ($v) { return array(['form_name' => $v, 'field_name' => 'recaptcha']); }) + ->end() ->prototype('array') ->children() ->scalarNode('form_name')
Simplify the configuration if only one form is used so that only the form name has to be specified.
nietonfir_GoogleRecaptchaBundle
train
php
eea401b58f77b982ad83ed4902369c2416424224
diff --git a/src/Charcoal/Property/HtmlProperty.php b/src/Charcoal/Property/HtmlProperty.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Property/HtmlProperty.php +++ b/src/Charcoal/Property/HtmlProperty.php @@ -3,7 +3,7 @@ namespace Charcoal\Property; // Local namespace dependencies -use \Charcoal\Property\StringProperty; +use Charcoal\Property\StringProperty; /** * HTML Property. @@ -14,6 +14,13 @@ class HtmlProperty extends StringProperty { /** + * The available filesystems (used in TinyMCE's elFinder media manager). + * + * @var string + */ + private $filesystem = ''; + + /** * @return string */ public function type() @@ -40,4 +47,23 @@ class HtmlProperty extends StringProperty { return 'TEXT'; } + + /** + * @return string + */ + public function filesystem() + { + return $this->filesystem; + } + + /** + * @param string $filesystem The file system. + * @return self + */ + public function setFilesystem($filesystem) + { + $this->filesystem = $filesystem; + + return $this; + } }
Add filesystem to HTMLProperty
locomotivemtl_charcoal-property
train
php
650dfd128edcfa276ac20a42e4afa21568d47aa8
diff --git a/bat/lib/release.rb b/bat/lib/release.rb index <HASH>..<HASH> 100644 --- a/bat/lib/release.rb +++ b/bat/lib/release.rb @@ -4,7 +4,7 @@ class Release attr_reader :versions def self.from_path(path, name="bat") - glob = File.join(path, "dev_releases", "#{name}-*.yml") + glob = File.join(path, "releases", "#{name}-*.yml") paths = Dir.glob(glob).sort raise "no matches" if paths.empty? versions = paths.map { |p| p.match(%r{/#{name}-([^/]+)\.yml})[1] } @@ -23,7 +23,7 @@ class Release def to_path file = "#{to_s}.yml" - File.join(@path, "dev_releases", file) + File.join(@path, "releases", file) end def version
Use final releases instead of dev releases for BAT
cloudfoundry_bosh
train
rb
3c1d98396553d324e2a2519a237d65c7ae77366e
diff --git a/PlugIns/Camera/CameraHardwareSource.py b/PlugIns/Camera/CameraHardwareSource.py index <HASH>..<HASH> 100644 --- a/PlugIns/Camera/CameraHardwareSource.py +++ b/PlugIns/Camera/CameraHardwareSource.py @@ -175,10 +175,11 @@ class CameraHardwareSource(HardwareSource.HardwareSource): return self.__record_parameters def set_selected_profile_index(self, profile_index): - self.__current_profile_index = profile_index - self.__camera_adapter.set_selected_profile_index(profile_index) - self.set_current_frame_parameters(self.__profiles[self.__current_profile_index]) - self.profile_changed_event.fire(profile_index) + if self.__current_profile_index != profile_index: + self.__current_profile_index = profile_index + self.__camera_adapter.set_selected_profile_index(profile_index) + self.set_current_frame_parameters(self.__profiles[self.__current_profile_index]) + self.profile_changed_event.fire(profile_index) @property def selected_profile_index(self):
Add fix for ping-pong profile index behavior. Added simulator support for testing. Was svn r<I>
nion-software_nionswift-instrumentation-kit
train
py
ac02b0238c8282d7dcb50e9ca47e97ab97bd8f67
diff --git a/models/errors.go b/models/errors.go index <HASH>..<HASH> 100644 --- a/models/errors.go +++ b/models/errors.go @@ -75,8 +75,11 @@ var ( } ) -func (err *Error) Equal(other *Error) bool { - return err.GetType() == other.GetType() +func (err *Error) Equal(other error) bool { + if e, ok := other.(*Error); ok { + return e.GetType() == err.GetType() + } + return false } type ErrInvalidField struct {
Allow Error to compare against error [#<I>]
cloudfoundry_bbs
train
go
ea2e87faece74b7ce4ec892892eacd9a2e348045
diff --git a/lib/nunes/subscriber.rb b/lib/nunes/subscriber.rb index <HASH>..<HASH> 100644 --- a/lib/nunes/subscriber.rb +++ b/lib/nunes/subscriber.rb @@ -38,8 +38,6 @@ module Nunes if respond_to?(method_name) send(method_name, start, ending, transaction_id, payload) - else - $stderr.puts "#{self.class.name} did not respond to #{method_name} therefore it cannot instrument the event named #{name}." end end
No need to write to stderr if event to method mapping doesn't exist.
jnunemaker_nunes
train
rb
591c045c6388de011b839658ff8f04964b0fc212
diff --git a/pointcloud.js b/pointcloud.js index <HASH>..<HASH> 100644 --- a/pointcloud.js +++ b/pointcloud.js @@ -360,7 +360,6 @@ fill_loop: textOffset[0] = -alignment[0] * (1+glyphBounds[0][0]) } - //Write out inner marker var cells = glyphMesh.cells var verts = glyphMesh.positions @@ -423,6 +422,12 @@ fill_loop: pool.free(idArray) //Update bounds + for(var i=0; i<3; ++i) { + if(lowerBounds[i] > upperBound[i]) { + lowerBound[i] = -Infinity + upperBound[i] = Infinity + } + } this.bounds = [lowerBound, upperBound] //Save points
fix bounds in degenerate case with <=1 input point
gl-vis_gl-scatter3d
train
js
460dabd45d0656f9289e3d238921ff9748872d7a
diff --git a/wal_e/wal_e.py b/wal_e/wal_e.py index <HASH>..<HASH> 100755 --- a/wal_e/wal_e.py +++ b/wal_e/wal_e.py @@ -32,6 +32,27 @@ LZOP_BIN = 'lzop' S3CMD_BIN = 's3cmd' +class UTC(datetime.tzinfo): + """ + UTC timezone + + Adapted from a Python example + + """ + + ZERO = datetime.timedelta(0) + HOUR = datetime.timedelta(hours=1) + + def utcoffset(self, dt): + return self.ZERO + + def tzname(self, dt): + return "UTC" + + def dst(self, dt): + return self.ZERO + + def subprocess_setup(f=None): """ SIGPIPE reset for subprocess workaround @@ -177,7 +198,13 @@ class PgBackupStatements(object): assert popen.returncode != 0 raise Exception('Could not start hot backup') - label = 'freeze_start_' + datetime.datetime.now().isoformat() + + # The difficulty of getting a timezone-stamped, UTC, + # ISO-formatted datetime is downright embarrassing. + # + # See http://bugs.python.org/issue5094 + label = 'freeze_start_' + (datetime.datetime.utcnow() + .replace(tzinfo=UTC()).isoformat()) return cls._dict_transform(psql_csv_run( "SELECT file_name, "
Timezone pedantry This was way too difficult. To the best of my knowledge, the timestamp used for the backup name is not used anywhere, but when fumbling through the program in my mind I realized this oversight. Credit to <EMAIL> for engaging my timezone pedantry a few weeks previously, where I argued that integer epoch times as an external representation are a step backward, and one should just use timezone labeling instead. I am now taking my own good advice.
wal-e_wal-e
train
py
ad4d7ce8b97dde1fba90516fb1d870319c627f84
diff --git a/api/server/version.go b/api/server/version.go index <HASH>..<HASH> 100644 --- a/api/server/version.go +++ b/api/server/version.go @@ -7,7 +7,7 @@ import ( ) // Version of IronFunctions -var Version = "0.1.61" +var Version = "0.1.62" func handleVersion(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"version": Version})
functions: <I> release [skip ci]
iron-io_functions
train
go
97b04f4f4e62fc874d5dd0ea651b21f85294539e
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -47,7 +47,7 @@ gulp.task('archive:zip', function (done) { // permissions, so we need to add files individually archiver.append(fs.createReadStream(filePath), { 'name': file, - 'mode': fs.statSync(filePath) + 'mode': fs.statSync(filePath).mode }); });
Make build set permissions in archive correctly Fix h5bp/html5-boilerplate#<I>
h5bp_html5-boilerplate
train
js
52afefa843bfe991ef04fb60656d70a6532ac390
diff --git a/v2/websocket/subscriptions.go b/v2/websocket/subscriptions.go index <HASH>..<HASH> 100644 --- a/v2/websocket/subscriptions.go +++ b/v2/websocket/subscriptions.go @@ -82,7 +82,9 @@ func (s *subscription) heartbeat() { } func (s *subscription) stopHeartbeatTimeout() { - s.hb.Stop() + if s.hb != nil { + s.hb.Stop() + } } func isPublic(request *SubscriptionRequest) bool {
added nil check for hb timer
bitfinexcom_bitfinex-api-go
train
go
57f75784c7a2562adfdd788d6baa24df34a983dc
diff --git a/test_flask_avatars.py b/test_flask_avatars.py index <HASH>..<HASH> 100644 --- a/test_flask_avatars.py +++ b/test_flask_avatars.py @@ -107,6 +107,16 @@ class AvatarsTestCase(unittest.TestCase): self.assertIn('/avatars/static/jcrop/js/Jcrop.min.js', rv) self.assertNotIn('<script src="https://cdn.jsdelivr.net/gh/tapmodo', rv) + def test_local_resources_when_development(self): + current_app.config['ENV'] = 'development' + rv = self.avatars.jcrop_css() + self.assertIn('/avatars/static/jcrop/css/Jcrop.min.css', rv) + self.assertNotIn('<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tapmodo', rv) + + rv = self.avatars.jcrop_js() + self.assertIn('/avatars/static/jcrop/js/Jcrop.min.js', rv) + self.assertNotIn('<script src="https://cdn.jsdelivr.net/gh/tapmodo', rv) + def test_init_jcrop(self): rv = self.avatars.init_jcrop() self.assertIn('var jcrop_api,', rv)
Add unit test for local resouces in dev
greyli_flask-avatars
train
py
c11e3a7f5a9de4c35d237698e68675f199266825
diff --git a/src/frontend/org/voltdb/client/AuthenticatedConnectionCache.java b/src/frontend/org/voltdb/client/AuthenticatedConnectionCache.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/client/AuthenticatedConnectionCache.java +++ b/src/frontend/org/voltdb/client/AuthenticatedConnectionCache.java @@ -272,7 +272,9 @@ public class AuthenticatedConnectionCache { throw new RuntimeException("Released client not in pool."); } if (force) { - conn.refCount = 0; + //Dont bother with target size of pool and remove dead connection. + m_connections.remove(ckey); + closeClient(conn.client); } else { conn.refCount--; }
ENG-<I>: remove dead connection quickly.
VoltDB_voltdb
train
java
1e0473c04af212fe1743e021b957cd076e189b33
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1760,6 +1760,7 @@ class Minion(MinionBase): self.socket.connect(self.master_pub) self.poller.register(self.socket, zmq.POLLIN) self.poller.register(self.epull_sock, zmq.POLLIN) + self.functions, self.returners, self.function_errors = self._load_modules() self._fire_master_minion_start() log.info('Minion is ready to receive requests!')
Re-init modules on multi-master reconnect
saltstack_salt
train
py
27c1c88aace466c8eea216cd23c9f0fa88a00af4
diff --git a/src/saucelabs/job.js b/src/saucelabs/job.js index <HASH>..<HASH> 100644 --- a/src/saucelabs/job.js +++ b/src/saucelabs/job.js @@ -58,7 +58,24 @@ export default class Job { await(wait(CHECK_TEST_RESULT_DELAY)); - testResult = await this.browser.eval('window.global_test_results'); + try { + testResult = await this.browser.eval('window.global_test_results'); + } + catch (error) { + var windowErrorMessage = 'window has no properties'; + + // NOTE: this error may occur while testing against internet explorer 11. + // This may happen because the IE driver sometimes throws an unknown error + // when executing an expression with the 'window' object. + var ie11ErrorMessage = [ + 'Error response status: 13, , ', + 'UnknownError - An unknown server-side error occurred while processing the command. ', + 'Selenium error: JavaScript error (WARNING: The server did not provide any stacktrace information)' + ].join(''); + + if (error.message.indexOf(windowErrorMessage) < 0 && error.message.indexOf(ie11ErrorMessage) < 0) + throw error; + } } return testResult; @@ -144,7 +161,7 @@ export default class Job { this._reportError(error); jobFailed = true; } - + try { await this.browser.quit(); }
Errors thrown when fetching test results are handled (close #<I>)
AlexanderMoskovkin_qunit-harness
train
js
c8fafc20686da2d5d90a6a200cebb99221a90dff
diff --git a/salt/states/mount.py b/salt/states/mount.py index <HASH>..<HASH> 100644 --- a/salt/states/mount.py +++ b/salt/states/mount.py @@ -18,6 +18,7 @@ Mount any type of mountable filesystem with the mounted function: # Import python libs import os.path +import re # Import salt libs from salt._compat import string_types @@ -90,6 +91,19 @@ def mounted(name, real_device = os.path.realpath(device) else: real_device = device + + # LVS devices have 2 names under /dev: + # /dev/mapper/vgname-lvname and /dev/vgname/lvname + # No matter what name is used for mounting, + # mount always displays the device as /dev/mapper/vgname-lvname + # So, let's call that the canonical device name + # We should normalize names of the /dev/vgname/lvname type to the canonical name + m = re.match(r'^/dev/(?P<vg_name>[^/]+)/(?P<lv_name>[^/]+$)', device) + if m: + mapper_device = '/dev/mapper/{vg_name}-{lv_name}'.format(**m.groupdict()) + if os.path.exists(mapper_device): + real_device = mapper_device + device_list = [] if real_name in active: device_list.append(active[real_name]['device'])
use /dev/mapper name for LVM devices Fixes #<I> LVM devices can be referenced by either `/dev/vgname/lvname` or `/dev/mapper/vgname-lvname` However mount always returns the `/dev/mapper` name. We should convert names to the `/dev/mapper` format.
saltstack_salt
train
py
d2c5a6e637e9fa3e1fdce04dc27b871adf45e321
diff --git a/stdlib/src/main/java/com/peterphi/std/util/jaxb/JAXBSerialiser.java b/stdlib/src/main/java/com/peterphi/std/util/jaxb/JAXBSerialiser.java index <HASH>..<HASH> 100755 --- a/stdlib/src/main/java/com/peterphi/std/util/jaxb/JAXBSerialiser.java +++ b/stdlib/src/main/java/com/peterphi/std/util/jaxb/JAXBSerialiser.java @@ -294,7 +294,10 @@ public class JAXBSerialiser */ public Object deserialise(String xml) { - return deserialise(new InputSource(new StringReader(xml))); + if (xml == null) + throw new IllegalArgumentException("Must provide non-null XML to deserialise!"); + else + return deserialise(new InputSource(new StringReader(xml))); } @@ -307,7 +310,10 @@ public class JAXBSerialiser */ public Object deserialise(final InputStream is) { - return deserialise(new InputSource(is)); + if (is == null) + throw new IllegalArgumentException("Must provide non-null InputStream XML to deserialise!"); + else + return deserialise(new InputSource(is)); }
Add nullness checks to JAXBSerialiser.deserialise taking a String or taking an InputStream to make sure that the error thrown is as clear as possible about the bug to be fixed
petergeneric_stdlib
train
java
6026a79e7a69d0b07d2a5de8be7150cf821d2691
diff --git a/wandb/wandb_agent.py b/wandb/wandb_agent.py index <HASH>..<HASH> 100644 --- a/wandb/wandb_agent.py +++ b/wandb/wandb_agent.py @@ -342,7 +342,7 @@ class AgentApi(object): def run_agent(sweep_id, function=None, in_jupyter=None, entity=None, project=None, count=None): - if not isinstance(sweep_id, str): + if not isinstance(sweep_id, six.string_types): wandb.termerror('Expected string sweep_id') return
fix bad string check with python <I> (#<I>)
wandb_client
train
py
fd68f9f41b3ce17b70b65317b78fcc425a62efb6
diff --git a/salt/transport/__init__.py b/salt/transport/__init__.py index <HASH>..<HASH> 100644 --- a/salt/transport/__init__.py +++ b/salt/transport/__init__.py @@ -58,11 +58,23 @@ class RAETChannel(Channel): Build the communication framework to communicate over the local process uxd socket and send messages forwarded to the master. then wait for the relative return message. + + Two use cases: + mininion to master communication, normal use case + Minion is communicating via yard through minion Road to master + The destination route needs the estate name of the associated master + master call via runner, special use case + In the special case the master call external process is communicating + via a yard with the master manor yard + The destination route estate is None to indicate local estate + + The difference between the two is how the destination route + is assigned. ''' def __init__(self, opts, **kwargs): self.opts = opts self.ttype = 'raet' - self.dst = ('master', None, 'remote_cmd') + self.dst = ('master', None, 'remote_cmd') # minion to master comms #self.dst = (None, None, 'remote_cmd') self.stack = None
Added comments about RAETChannel use cases
saltstack_salt
train
py
b8892bf6a9659b0f16b8d28f353b42a0640099a7
diff --git a/src/Page/Page.php b/src/Page/Page.php index <HASH>..<HASH> 100644 --- a/src/Page/Page.php +++ b/src/Page/Page.php @@ -44,7 +44,7 @@ class Page extends AbstractItem implements \ArrayAccess /** * @var string * - * 'homepage', 'list' or 'page' + * 'homepage', 'section', 'taxonomy', 'terms' or 'page' */ protected $nodeType = 'page';
Updating Page/Page comments
Cecilapp_PHPoole
train
php
373eacecc08f74d7f9adc0b1321f2bf7fe6d5966
diff --git a/treebeard/tests/test_treebeard.py b/treebeard/tests/test_treebeard.py index <HASH>..<HASH> 100644 --- a/treebeard/tests/test_treebeard.py +++ b/treebeard/tests/test_treebeard.py @@ -2403,8 +2403,12 @@ class TestAdminTree(TestNonEmptyTree): request = RequestFactory().get('/admin/tree/') site = AdminSite() form_class = movenodeform_factory(model) - admin_class = admin_factory(form_class) - m = admin_class(model, site) + ModelAdmin = admin_factory(form_class) + + class UnicodeModelAdmin(ModelAdmin): + list_display = ('__str__', 'desc') + + m = UnicodeModelAdmin(model, site) list_display = m.get_list_display(request) list_display_links = m.get_list_display_links(request, list_display) cl = ChangeList(request, model, list_display, list_display_links,
Extend unicode results test for admin tree tag in order to check lookup field resolution.
django-treebeard_django-treebeard
train
py
78ea0c476b2f1f3bf8844ea272f7691c47b9f806
diff --git a/VERSION b/VERSION index <HASH>..<HASH> 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.11.0 +2.11.1-SNAPSHOT diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,9 +58,9 @@ author = u'IBM' # built documents. # # The short X.Y version. -version = '2.11.0' +version = '2.11.1-SNAPSHOT' # The full version, including alpha/beta/rc tags. -release = '2.11.0' +release = '2.11.1-SNAPSHOT' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/cloudant/__init__.py b/src/cloudant/__init__.py index <HASH>..<HASH> 100644 --- a/src/cloudant/__init__.py +++ b/src/cloudant/__init__.py @@ -15,7 +15,7 @@ """ Cloudant / CouchDB Python client library API package """ -__version__ = '2.11.0' +__version__ = '2.11.1-SNAPSHOT' # pylint: disable=wrong-import-position import contextlib
Update version to <I>-SNAPSHOT
cloudant_python-cloudant
train
VERSION,py,py
c6a2f52c1a155fc7e2ba0a6571d915c55be68b9a
diff --git a/lands/guiqt.py b/lands/guiqt.py index <HASH>..<HASH> 100644 --- a/lands/guiqt.py +++ b/lands/guiqt.py @@ -8,6 +8,7 @@ GUI Interface for Lands import sys from PyQt4 import QtGui import random +import threading class GenerateDialog(QtGui.QDialog): @@ -110,6 +111,15 @@ class GenerationProgressDialog(QtGui.QDialog): def _on_cancel(self): QtGui.QDialog.reject(self) + +class GenerationThread(threading.Thread): + + def __init__(self): + threading.Thread.__init__(self) + + def run (self): + print("thread") + class LandsGui(QtGui.QMainWindow): def __init__(self): @@ -146,7 +156,9 @@ class LandsGui(QtGui.QMainWindow): dialog = GenerateDialog() ok = dialog.exec_() if ok: + gen_thread = GenerationThread() dialog2 = GenerationProgressDialog() + gen_thread.start() ok2 = dialog2.exec_() def main():
qt: generation thread created Former-commit-id: <I>e<I>caf<I>efba<I>fe<I>bfcf<I>fd
Mindwerks_worldengine
train
py
ee00fe5349ce368566e723f06bb1f507041126e9
diff --git a/net_utils.js b/net_utils.js index <HASH>..<HASH> 100644 --- a/net_utils.js +++ b/net_utils.js @@ -199,7 +199,7 @@ exports.same_ipv4_network = function (ip, ipList) { exports.get_public_ip = function (cb) { var nu = this; - if (nu.public_ip) { + if (nu.public_ip !== undefined) { return cb(null, nu.public_ip); // cache } @@ -210,6 +210,10 @@ exports.get_public_ip = function (cb) { return cb(null, nu.public_ip); } + // Initialise cache value to null to prevent running + // should we hit a timeout or the module isn't installed. + nu.public_ip = null; + try { nu.stun = require('vs-stun'); } @@ -238,6 +242,7 @@ exports.get_public_ip = function (cb) { if (!socket.stun.public) { return cb(new Error('invalid STUN result')); } + nu.public_ip = socket.stun.public.host; return cb(null, socket.stun.public.host); };
Fix caching of STUN results * Fix caching of STUN results * Remove trailing whitespace Fixes lint problem
haraka_Haraka
train
js
4e519721cb2c71909d9e9003a39d1d1cd49eb8d2
diff --git a/src/services/filters.js b/src/services/filters.js index <HASH>..<HASH> 100644 --- a/src/services/filters.js +++ b/src/services/filters.js @@ -52,8 +52,6 @@ ngeo.module.filter('ngeoScalify', ngeo.Scalify); */ ngeo.Number = function($locale) { var formats = $locale.NUMBER_FORMATS; - var groupSep = formats.GROUP_SEP; - var decimalSep = formats.DECIMAL_SEP; /** * @param {number} number The number to format. @@ -61,6 +59,8 @@ ngeo.Number = function($locale) { * @return {string} The formatted string. */ var result = function(number, opt_precision) { + var groupSep = formats.GROUP_SEP; + var decimalSep = formats.DECIMAL_SEP; if (opt_precision === undefined) { opt_precision = 3; }
Fix the number locale in the redligning
camptocamp_ngeo
train
js
2946efe8ec76cb35766e2aab947710068d3c48c1
diff --git a/src/featherlight.gallery.js b/src/featherlight.gallery.js index <HASH>..<HASH> 100644 --- a/src/featherlight.gallery.js +++ b/src/featherlight.gallery.js @@ -99,20 +99,25 @@ galleryFadeIn: 100, /* fadeIn speed when image is loaded */ galleryFadeOut: 300, /* fadeOut speed before image is loaded */ - images: function() { + slides: function() { if (this.filter) { return this.$source.find(this.filter); } return this.$source; }, + images: function() { + warn('images is deprecated, please use slides instead'); + return this.slides(); + }, + currentNavigation: function() { - return this.images().index(this.$currentTarget); + return this.slides().index(this.$currentTarget); }, navigateTo: function(index) { var self = this, - source = self.images(), + source = self.slides(), len = source.length, $inner = self.$instance.find('.' + self.namespace + '-inner'); index = ((index % len) + len) % len; /* pin index to [0, len[ */
Gallery: Rename images -> slides
noelboss_featherlight
train
js
ade143f756220144e1d1e59304d5091fa2115a0f
diff --git a/fvt_test.go b/fvt_test.go index <HASH>..<HASH> 100644 --- a/fvt_test.go +++ b/fvt_test.go @@ -29,7 +29,7 @@ var ( func init() { FVTAddr := os.Getenv("TEST_FVT_ADDR") if FVTAddr == "" { - FVTAddr = "iot.eclipse.org" + FVTAddr = "127.0.0.1" } FVTTCP = "tcp://" + FVTAddr + ":1883" FVTSSL = "ssl://" + FVTAddr + ":8883"
iot.eclipse.org seems to be slow and unreliable, assume a local broker
eclipse_paho.mqtt.golang
train
go
abb0788381b17d07f282e7451299dba79ea6e1be
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,7 @@ setup( # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',
Python 2 is supported, setup.py should reflect that
Nagasaki45_bibo
train
py
2cf6470a372751919f0cd045624e93ed651b39d4
diff --git a/agent/core/src/main/java/org/jolokia/detector/JBossDetector.java b/agent/core/src/main/java/org/jolokia/detector/JBossDetector.java index <HASH>..<HASH> 100644 --- a/agent/core/src/main/java/org/jolokia/detector/JBossDetector.java +++ b/agent/core/src/main/java/org/jolokia/detector/JBossDetector.java @@ -52,5 +52,5 @@ public class JBossDetector extends AbstractServerDetector { /* jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/jolokia --> path - +jboss.web:name=HttpRequest1,type=RequestProcessor,worker=http-bhut%2F172.16.239.130-8080 --> remoteAddr, serverPort, protocol */ \ No newline at end of file
Remember some interesting MBeans in JBossDetector (comment).
rhuss_jolokia
train
java
b75320ba95e2033f7c12b400c0d587e989667d08
diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index <HASH>..<HASH> 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -83,7 +83,7 @@ def pytest_pyfunc_call(pyfuncitem): testfunction = pyfuncitem.obj pyfuncitem.obj = pdb.runcall if pyfuncitem._isyieldedfunction(): - pyfuncitem.args = [testfunction, pyfuncitem._args] + pyfuncitem._args = [testfunction, *pyfuncitem._args] else: if "func" in pyfuncitem._fixtureinfo.argnames: raise ValueError("--trace can't be used with a fixture named func!")
Fix --trace option with yield tests.
pytest-dev_pytest
train
py
1068da2d42fe9d520b67a72e8a38474f95831ced
diff --git a/coconut/root.py b/coconut/root.py index <HASH>..<HASH> 100644 --- a/coconut/root.py +++ b/coconut/root.py @@ -30,7 +30,7 @@ except ImportError: # CONSTANTS: #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -VERSION = "0.2.1-dev" +VERSION = "0.2.1" VERSION_NAME = "Fiji" VERSION_STR = VERSION + " [" + VERSION_NAME + "]"
Updates to version <I> [Fiji]
evhub_coconut
train
py
80d6e757d9c55ad0f3259a5d5f1aa4c606605b2c
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/XExpressionHelper.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/XExpressionHelper.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/XExpressionHelper.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/XExpressionHelper.java @@ -14,6 +14,7 @@ import org.eclipse.xtext.common.types.util.TypeReferences; import org.eclipse.xtext.xbase.XAbstractFeatureCall; import org.eclipse.xtext.xbase.XBinaryOperation; import org.eclipse.xtext.xbase.XExpression; +import org.eclipse.xtext.xbase.XbasePackage; import org.eclipse.xtext.xbase.typing.ITypeProvider; import org.eclipse.xtext.xbase.typing.XbaseTypeConformanceComputer; @@ -34,6 +35,8 @@ public class XExpressionHelper { private TypeReferences typeReferences; public boolean isLiteral(XExpression expr) { + if (expr.eClass().getEPackage() != XbasePackage.eINSTANCE) + return false; switch(expr.eClass().getClassifierID()) { case XCLOSURE: case XBOOLEAN_LITERAL:
[xbase] Fix: default implementation of ExpressionHelper#isLiteral should take the EPackage of the EClasses into account see <URL>
eclipse_xtext-extras
train
java
a8bac2f202a50d06d1ec6583e40b8ea33f000467
diff --git a/ca/django_ca/utils.py b/ca/django_ca/utils.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/utils.py +++ b/ca/django_ca/utils.py @@ -88,7 +88,10 @@ def get_cert_profile_kwargs(name=None): name = ca_settings.CA_DEFAULT_PROFILE profile = ca_settings.CA_PROFILES[name] - kwargs = {} + kwargs = { + 'cn_in_san': profile['cn_in_san'], + 'subject': profile['subject'], + } for arg in ['basicConstraints', 'keyUsage', 'extendedKeyUsage']: config = profile[arg] if config is None:
use cn_in_san and subject
mathiasertl_django-ca
train
py
4d2cb0b14520a195e0a87d20bc72e8140276fc45
diff --git a/minify.go b/minify.go index <HASH>..<HASH> 100644 --- a/minify.go +++ b/minify.go @@ -257,7 +257,8 @@ type minifyWriter struct { // Write intercepts any writes to the writer. func (w *minifyWriter) Write(b []byte) (int, error) { - return w.pw.Write(b) + n, _ := w.pw.Write(b) + return n, w.err } // Close must be called when writing has finished. It returns the error from the minifier. @@ -278,8 +279,8 @@ func (m *M) Writer(mediatype string, w io.Writer) *minifyWriter { defer mw.wg.Done() if err := m.Minify(mediatype, w, pr); err != nil { - io.Copy(w, pr) mw.err = err + io.Copy(w, pr) } pr.Close() }()
Error reporting for Writer, ResponseWriter and Middleware may report sooner
tdewolff_minify
train
go
a43c0f2d70868ef3d1d6a2710cd99935b61d2b35
diff --git a/bika/lims/content/pricelist.py b/bika/lims/content/pricelist.py index <HASH>..<HASH> 100644 --- a/bika/lims/content/pricelist.py +++ b/bika/lims/content/pricelist.py @@ -64,12 +64,13 @@ Field.widget.visible = True Field = schema['effectiveDate'] Field.schemata = 'default' -Field.required = 1 +Field.required = 0 # "If no date is selected the item will be published + #immediately." Field.widget.visible = True Field = schema['expirationDate'] Field.schemata = 'default' -Field.required = 1 +Field.required = 0 # "If no date is chosen, it will never expire." Field.widget.visible = True
LIMS-<I> "If no date is chosen, it will never expire." not been accomplished.
senaite_senaite.core
train
py
af921f72495a9de907138b5c410ad3f443977c47
diff --git a/core/Log/Handler/StdErrHandler.php b/core/Log/Handler/StdErrHandler.php index <HASH>..<HASH> 100644 --- a/core/Log/Handler/StdErrHandler.php +++ b/core/Log/Handler/StdErrHandler.php @@ -36,7 +36,10 @@ class StdErrHandler extends AbstractProcessingHandler protected function write(array $record) { - $this->writeToStdErr($record['formatted']); + // Do not log on stderr during tests (prevent display of errors in CI output) + if (! defined('PIWIK_TEST_MODE')) { + $this->writeToStdErr($record['formatted']); + } // This is the result of an old hack, I guess to force the error message to be displayed in case of errors // TODO we should get rid of it somehow
#<I> Logger refactoring: StdErrHandler: had to revert a previous change In the tests, logging is disabled. But not when testing the logger itself…
matomo-org_matomo
train
php
48f5f3eae818745bad907b117ab23f6be187b140
diff --git a/src/main/java/com/semanticcms/file/model/File.java b/src/main/java/com/semanticcms/file/model/File.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/semanticcms/file/model/File.java +++ b/src/main/java/com/semanticcms/file/model/File.java @@ -22,9 +22,9 @@ */ package com.semanticcms.file.model; -import com.aoindustries.net.Path; +import com.aoindustries.exception.WrappedException; import com.aoindustries.lang.Strings; -import com.aoindustries.util.WrappedException; +import com.aoindustries.net.Path; import com.semanticcms.core.model.Element; import com.semanticcms.core.model.PageRef; import java.io.IOException;
Moved a few exceptions to the new com.aoindustries.exception package: NotImplementedException WrappedException WrappedExceptions
aoindustries_semanticcms-file-model
train
java
e77f4910d2f19786a2a20af6e24d5cf2a4f6b3bc
diff --git a/FeatureContext.php b/FeatureContext.php index <HASH>..<HASH> 100644 --- a/FeatureContext.php +++ b/FeatureContext.php @@ -292,9 +292,9 @@ class FeatureContext extends BehatContext { } /** - * @When /^I clone the "([^"]*)" repo$/ + * @When /^I clone the repo$/ */ - public function iCloneTheRepo($repo) { + public function iCloneTheRepo() { $session = $this->mink->getSession(); $element = $session->getPage(); $result = $element->find('css', '#content div.codeblock code'); @@ -310,9 +310,9 @@ class FeatureContext extends BehatContext { } /** - * @Then /^I should have a local copy$/ + * @Then /^I should have a local copy of "([^"]*)"$/ */ - public function iShouldHaveALocalCopy() { + public function iShouldHaveALocalCopyOf($repo) { if (!is_dir($repo)) { throw new Exception('The repo could not be found.'); }
Made I should have a local copy generic
jhedstrom_DrupalDriver
train
php
6010e66fb1d4c1b0c447d150fbc4ef1dcbd7cf6a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -130,11 +130,11 @@ function httpHandler(store, req, res) { // TODO: Go through key-vals first // "'Credential' not a valid key=value pair (missing equal-sign) in Authorization header: 'AWS4-HMAC-SHA256 \ // Signature=b, Credential, SignedHeaders'." - for (var i in headers) { - if (!authParams[headers[i]]) + headers.forEach(function(header) { + if (!authParams[header]) // TODO: SignedHeaders *is* allowed to be an empty string at this point - msg += 'Authorization header requires \'' + headers[i] + '\' parameter. ' - } + msg += 'Authorization header requires \'' + header + '\' parameter. ' + }) if (!date) msg += 'Authorization header requires existence of either a \'X-Amz-Date\' or a \'Date\' header. ' if (msg) {
Traverse headers as an array, not an object
mhart_kinesalite
train
js
3d370b7d459b532a9adeaf3ced50179c01ceb9e6
diff --git a/spacy/tests/tagger/test_lemmatizer.py b/spacy/tests/tagger/test_lemmatizer.py index <HASH>..<HASH> 100644 --- a/spacy/tests/tagger/test_lemmatizer.py +++ b/spacy/tests/tagger/test_lemmatizer.py @@ -51,6 +51,11 @@ def test_base_form_dive(lemmatizer): assert do('dive', number='plur') == set(['diva']) +def test_base_form_saw(lemmatizer): + do = lemmatizer.verb + assert do('saw', verbform='past') == set(['see']) + + def test_smart_quotes(lemmatizer): do = lemmatizer.punct assert do('“') == set(['"'])
Add test for Issue #<I>, fixed in 3cb4d<I>d, with improved lemmatizer logic
explosion_spaCy
train
py
8d376ed583c475fbb9525c2e4bd654e2cb981ecf
diff --git a/src/main/java/org/thymeleaf/spring3/view/AjaxThymeleafView.java b/src/main/java/org/thymeleaf/spring3/view/AjaxThymeleafView.java index <HASH>..<HASH> 100755 --- a/src/main/java/org/thymeleaf/spring3/view/AjaxThymeleafView.java +++ b/src/main/java/org/thymeleaf/spring3/view/AjaxThymeleafView.java @@ -30,6 +30,7 @@ import org.springframework.js.ajax.AjaxHandler; import org.springframework.util.StringUtils; import org.thymeleaf.TemplateEngine; import org.thymeleaf.dialect.IDialect; +import org.thymeleaf.dom.Attribute; import org.thymeleaf.dom.DOMSelector; import org.thymeleaf.dom.Node; import org.thymeleaf.exceptions.ConfigurationException; @@ -204,7 +205,7 @@ public class AjaxThymeleafView extends ThymeleafView implements AjaxEnabledView private static String getFragmentAttributeName(final TemplateEngine templateEngine) { // In most cases: "th:fragment" final String prefix = getStandardDialectPrefix(templateEngine); - return Node.applyDialectPrefix(StandardFragmentAttrProcessor.ATTR_NAME, prefix); + return Attribute.applyPrefixToAttributeName(StandardFragmentAttrProcessor.ATTR_NAME, prefix); }
Segregated element/attribute name normalization and prefixing methods
thymeleaf_thymeleaf
train
java
301f99f77cc55fbf76305bea5995292bea1790da
diff --git a/app/code/community/Jowens/JobQueue/Block/Adminhtml/Queue/Grid.php b/app/code/community/Jowens/JobQueue/Block/Adminhtml/Queue/Grid.php index <HASH>..<HASH> 100644 --- a/app/code/community/Jowens/JobQueue/Block/Adminhtml/Queue/Grid.php +++ b/app/code/community/Jowens/JobQueue/Block/Adminhtml/Queue/Grid.php @@ -21,7 +21,7 @@ class Jowens_JobQueue_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Wi { $collection = Mage::getModel('jobqueue/job')->getCollection(); //$collection->getSelect()->columns('(`main_table`.`failed_at` is null) as status'); - $collection->getSelect()->columns("('status') = case when locked_at is not null then 2 when failed_at is not null then 1 else 0 end as status"); + $collection->getSelect()->columns("(case when main_table.locked_at is not null then 2 when main_table.failed_at is null then 1 else 0 end) as status"); $this->setCollection($collection); return parent::_prepareCollection();
Fix issue displaying status in admin grid
jkowens_magento-jobqueue
train
php
a2749017ef461dd4f0843bc73c826ce55a5fd63f
diff --git a/src/Illuminate/Database/Connectors/ConnectionFactory.php b/src/Illuminate/Database/Connectors/ConnectionFactory.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -175,7 +175,7 @@ class ConnectionFactory protected function createPdoResolverWithHosts(array $config) { return function () use ($config) { - foreach (Arr::shuffle($this->parseHosts($config)) as $key => $host) { + foreach (Arr::shuffle($hosts = $this->parseHosts($config)) as $key => $host) { $config['host'] = $host; try {
Fix undefined variable hosts (#<I>)
laravel_framework
train
php
0da0508e98dee6189090c63c0b31e55a2df49b79
diff --git a/src/plugins/background_button/background_button.js b/src/plugins/background_button/background_button.js index <HASH>..<HASH> 100644 --- a/src/plugins/background_button/background_button.js +++ b/src/plugins/background_button/background_button.js @@ -26,9 +26,7 @@ class BackgroundButton extends UICorePlugin { bindEvents() { this.listenTo(this.core.mediaControl.container, 'container:state:buffering', this.hide) this.listenTo(this.core.mediaControl.container, 'container:state:bufferfull', this.show) - this.listenTo(this.core.mediaControl.container, 'container:settingsupdate', this.settingsUpdate) - this.listenTo(this.core.mediaControl.container, 'container:dvr', this.settingsUpdate) - this.listenTo(this.core.mediaControl, 'mediacontrol:containerchanged', this.settingsUpdate) + this.listenTo(this.core.mediaControl, 'mediacontrol:rendered', this.settingsUpdate) this.listenTo(this.core.mediaControl, 'mediacontrol:show', this.updateSize) this.listenTo(this.core.mediaControl, 'mediacontrol:playing', this.playing) this.listenTo(this.core.mediaControl, 'mediacontrol:notplaying', this.notplaying)
background button: change to use rendered event from mediacontrol
clappr_clappr
train
js
90da359fa348384667441be004c327c9ef0a17de
diff --git a/django_js_reverse/tests/unit_tests.py b/django_js_reverse/tests/unit_tests.py index <HASH>..<HASH> 100755 --- a/django_js_reverse/tests/unit_tests.py +++ b/django_js_reverse/tests/unit_tests.py @@ -109,9 +109,9 @@ class JSReverseStaticFileSaveTest(JSReverseViewTestCaseMinified): path = join(package_path, 'static', 'django_js_reverse', 'js', 'reverse.js') f = open(path) f_content = f.read() - print f_content r2 = self.client.get('/jsreverse/') - self.assertEqual(f_content, r2.content, "Static file don't match http response content") + self.assertEqual(len(f_content), len(r2.content), "Static file don't match http response content_1") + self.assertEqual(f_content, r2.content, "Static file don't match http response content_2")
reverse.js file save test fix
ierror_django-js-reverse
train
py
cd75bbc8a8fc91bf52fc6b05131932baef701be1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ /**! * is * the definitive JavaScript type testing library - * + * * @copyright 2013 Enrico Marino * @license MIT */ @@ -14,10 +14,10 @@ var isActualNaN = function (value) { return value !== value; }; var NON_HOST_TYPES = { - "boolean": 1, - "number": 1, - "string": 1, - "undefined": 1 + boolean: 1, + number: 1, + string: 1, + undefined: 1 }; /** @@ -76,7 +76,9 @@ is.empty = function (value) { } if ('[object Object]' === type) { - for (key in value) if (owns.call(value, key)) return false; + for (key in value) { + if (owns.call(value, key)) { return false; } + } return true; }
Fixing lint errors.
enricomarino_is
train
js
e7acbee6a420b7cefec1a005ae5e14aa6f5fd650
diff --git a/tests/pool_test.py b/tests/pool_test.py index <HASH>..<HASH> 100644 --- a/tests/pool_test.py +++ b/tests/pool_test.py @@ -552,3 +552,32 @@ async def test_async_with(create_pool, server, loop): async with pool.get() as conn: msg = await conn.execute('echo', 'hello') assert msg == b'hello' + + [email protected]_loop +async def test_pool__drop_closed(create_pool, server, loop): + pool = await create_pool(server.tcp_address, + minsize=3, + maxsize=3, + loop=loop) + assert pool.size == 3 + assert pool.freesize == 3 + assert not pool._pool[0].closed + assert not pool._pool[1].closed + assert not pool._pool[2].closed + + pool._pool[1].close() + pool._pool[2].close() + await pool._pool[1].wait_closed() + await pool._pool[2].wait_closed() + + assert not pool._pool[0].closed + assert pool._pool[1].closed + assert pool._pool[2].closed + + assert pool.size == 3 + assert pool.freesize == 3 + + pool._drop_closed() + assert pool.freesize == 1 + assert pool.size == 1
add _drop_closed test
aio-libs_aioredis
train
py
fb4bdfd943fdfac72f871195ab6b591cb3fb272c
diff --git a/openquake/risklib/scientific.py b/openquake/risklib/scientific.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/scientific.py +++ b/openquake/risklib/scientific.py @@ -170,7 +170,7 @@ class VulnerabilityFunction(object): if epsilons is None: return means self.set_distribution(epsilons) - return self.distribution.sample(means, covs, None, idxs) + return self.distribution.sample(means, covs, means * covs, idxs) # this is used in the tests, not in the engine code base def __call__(self, gmvs, epsilons):
Fix on VulnerabilityFunction.sample, now the stddevs are passed [skip hazardlib] Former-commit-id: a<I>c3fc<I>b8f<I>f3b8ad9f4be<I>f6
gem_oq-engine
train
py
917c9033b8230fa1f25e0c33000380edca71b5f0
diff --git a/tests/Broadcasting/BroadcastEventTest.php b/tests/Broadcasting/BroadcastEventTest.php index <HASH>..<HASH> 100644 --- a/tests/Broadcasting/BroadcastEventTest.php +++ b/tests/Broadcasting/BroadcastEventTest.php @@ -24,7 +24,7 @@ class BroadcastEventTest extends TestCase $event = new TestBroadcastEvent; - (new \Illuminate\Broadcasting\BroadcastEvent($event))->handle($broadcaster); + (new BroadcastEvent($event))->handle($broadcaster); } public function testManualParameterSpecification()
Don't use fully qualified classnames in Broadcasting tests (#<I>)
laravel_framework
train
php
bc54d15e9a580c279b502a960a01ba892af488a4
diff --git a/salt/spm/__init__.py b/salt/spm/__init__.py index <HASH>..<HASH> 100644 --- a/salt/spm/__init__.py +++ b/salt/spm/__init__.py @@ -259,7 +259,7 @@ class SPMClient(object): if pkg.endswith('.spm'): if self._pkgfiles_fun('path_exists', pkg): comps = pkg.split('-') - comps = '-'.join(comps[:-2]).split('/') + comps = '-'.join(comps[:-2]).split(os.path.sep) pkg_name = comps[-1] formula_tar = tarfile.open(pkg, 'r:bz2')
Fix wart in spm on windows
saltstack_salt
train
py
39504c526a5df55ed17ea560e06d5aeddbdc5513
diff --git a/lib/msg-auth.js b/lib/msg-auth.js index <HASH>..<HASH> 100644 --- a/lib/msg-auth.js +++ b/lib/msg-auth.js @@ -91,7 +91,7 @@ MsgAuth.prototype.getBufForSig = function () { return bw.toBuffer() } -MsgAuth.prototype.validate = function () { +MsgAuth.prototype.asyncVerify = function () { return AsyncCrypto.sha256(this.getBufForSig()).then(hashbuf => { return AsyncCrypto.verifyCompactSig(hashbuf, this.sig) }).then(info => { diff --git a/test/lib/msg-auth.js b/test/lib/msg-auth.js index <HASH>..<HASH> 100644 --- a/test/lib/msg-auth.js +++ b/test/lib/msg-auth.js @@ -96,9 +96,9 @@ describe('MsgAuth', function () { }) }) - describe('#validate', function () { + describe('#asyncVerify', function () { it('should know this is a valid auth message', function () { - return msgauth.validate().then(valid => { + return msgauth.asyncVerify().then(valid => { valid.should.equal(true) }) })
validate -> asyncVerify In keeping consistency with content-auth, this method should be named asyncVerify.
moneybutton_yours-core
train
js,js
22966b8db2821fd3a954cd04ea0bcfc3d9520999
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,19 @@ from distutils.core import setup setup( name = 'trackit', - packages = ['trackit'], # this must be the same as the name above + packages = ['trackit'], version = '0.1', description = 'Tracking APIs for couriers with major courier companies', author = 'K R Prajwal', author_email = '[email protected]', - url = 'https://github.com/prajwalkr/track-it', # use the URL to the github repo - download_url = 'https://github.com/prajwalkr/track-it/tarball/0.1', # I'll explain this in a second - keywords = ['couriers', 'tracking', 'api', 'courier-tracking'], # arbitrary keywords + url = 'https://github.com/prajwalkr/track-it', + download_url = 'https://github.com/prajwalkr/track-it/tarball/0.1', + keywords = ['couriers', 'tracking', 'api', 'courier-tracking'], classifiers = [], + install_requires=[ + "beautifulsoup4==4.4.1", + "selenium==2.48.0", + "requests==2.2.1", + "python-dateutil==2.4.2", + ] ) \ No newline at end of file
Converted to a PyPI package
prajwalkr_track-it
train
py
09cfe6eb963dd4b0cb25c8e026d2d5b1c7f46b66
diff --git a/samples/contacts/src/main/java/sample/contact/Contact.java b/samples/contacts/src/main/java/sample/contact/Contact.java index <HASH>..<HASH> 100644 --- a/samples/contacts/src/main/java/sample/contact/Contact.java +++ b/samples/contacts/src/main/java/sample/contact/Contact.java @@ -15,13 +15,16 @@ package sample.contact; +import java.io.Serializable; + + /** * Represents a contact. * * @author Ben Alex * @version $Id$ */ -public class Contact { +public class Contact implements Serializable { //~ Instance fields ======================================================== private Integer id;
Make Serializable (required by RMI).
spring-projects_spring-security
train
java
42c57ee4fe269ced6ba732bdc0a351b58f06e89f
diff --git a/geneparse/extract/__main__.py b/geneparse/extract/__main__.py index <HASH>..<HASH> 100644 --- a/geneparse/extract/__main__.py +++ b/geneparse/extract/__main__.py @@ -252,7 +252,11 @@ def parse_args(): parser = argparse.ArgumentParser( prog="geneparse-extractor", description="Genotype file extractor. This tool will extract markers " - "according to names or to genomic locations." + "according to names or to genomic locations.", + epilog="The parser arguments (PARSER_ARGS) are the same as the one in " + "the API. For example, the arguments for the Plink parser is " + "'prefix:PREFIX' (where PREFIX is the prefix of the " + "BED/BIM/FAM files).", ) # The input file format @@ -264,7 +268,7 @@ def parse_args(): ) group.add_argument( - nargs="+", dest="parser_args", type=str, + nargs="+", dest="parser_args", type=str, metavar="PARSER_ARGS", help="The arguments that will be passed to the genotype parsers.", )
Added an epilog to the manual
pgxcentre_geneparse
train
py
9f107e698c3c6d95687c08f4e72cbbad43583c2b
diff --git a/web/opensubmit/admin/submission.py b/web/opensubmit/admin/submission.py index <HASH>..<HASH> 100644 --- a/web/opensubmit/admin/submission.py +++ b/web/opensubmit/admin/submission.py @@ -122,7 +122,7 @@ class SubmissionAdmin(ModelAdmin): ''' This is our version of the admin view for a single submission. ''' - list_display = ['__unicode__', 'modified', authors, course, 'assignment', 'state', 'grading', grading_notes, grading_file] + list_display = ['__unicode__', 'created', 'modified', authors, course, 'assignment', 'state', 'grading', grading_notes] list_filter = (SubmissionStateFilter, SubmissionCourseFilter, SubmissionAssignmentFilter) filter_horizontal = ('authors',) actions = ['setInitialStateAction', 'setFullPendingStateAction','setGradingNotFinishedStateAction', 'closeAndNotifyAction', 'notifyAction', 'getPerformanceResultsAction']
Show creation and modification date in submission overview. Make space by leaving out the grading file indicator. Closes #<I>
troeger_opensubmit
train
py
26bc867151a8f302b4c6122e6375c3ea2088a037
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/assertions/response_assertions.rb +++ b/actionpack/lib/action_controller/assertions/response_assertions.rb @@ -87,13 +87,13 @@ module ActionController # def assert_template(expected = nil, message=nil) clean_backtrace do - rendered = @response.rendered_template.to_s + rendered = @response.rendered_template msg = build_message(message, "expecting <?> but rendering with <?>", expected, rendered) assert_block(msg) do if expected.nil? - @response.rendered_template ? true : false + @response.rendered_template.nil? else - rendered.match(expected) + rendered.to_s.match(expected) end end end
Small tweak to e0fef<I>
rails_rails
train
rb
2d6a3edc72a6c32b515ea4312cea9abbb4e0599a
diff --git a/internal/binarylog/env_config.go b/internal/binarylog/env_config.go index <HASH>..<HASH> 100644 --- a/internal/binarylog/env_config.go +++ b/internal/binarylog/env_config.go @@ -74,7 +74,7 @@ func (l *logger) fillMethodLoggerWithConfigString(config string) error { return fmt.Errorf("invalid config: %q, %v", config, err) } if m == "*" { - return fmt.Errorf("invalid config: %q, %v", config, "* not allowd in blacklist config") + return fmt.Errorf("invalid config: %q, %v", config, "* not allowed in blacklist config") } if suffix != "" { return fmt.Errorf("invalid config: %q, %v", config, "header/message limit not allowed in blacklist config")
cleanup: fix typo (#<I>)
grpc_grpc-go
train
go
559b1009c33a0eb094c6aa7ccbf192e03134fa8e
diff --git a/Classes/Lib/Pluginbase.php b/Classes/Lib/Pluginbase.php index <HASH>..<HASH> 100644 --- a/Classes/Lib/Pluginbase.php +++ b/Classes/Lib/Pluginbase.php @@ -1168,9 +1168,10 @@ class Pluginbase extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin */ public function getCalEventEnddate($eventUid) { + $table = 'tx_cal_event'; $queryBuilder = Db::getQueryBuilder($table); $row = $queryBuilder - ->select('end_date, end_time, allday, start_date') + ->select('end_date', 'end_time', 'allday', 'start_date') ->from($table) ->where( $queryBuilder->expr()->eq(
[BUGFIX] fix missing tablename and wrong select arguments for cal events
teaminmedias-pluswerk_ke_search
train
php
a89eb309857d44a3678760da1fe8d6cc3ab1cab0
diff --git a/src/hunter/actions.py b/src/hunter/actions.py index <HASH>..<HASH> 100644 --- a/src/hunter/actions.py +++ b/src/hunter/actions.py @@ -310,13 +310,6 @@ class VarsPrinter(Fields.names.globals.stream.filename_alignment, ColorStreamAct filename_alignment (int): Default size for the filename column (files are right-aligned). Default: ``40``. force_colors (bool): Force coloring. Default: ``False``. repr_limit (bool): Limit length of ``repr()`` output. Default: ``512``. - - .. note:: - This is the default action. - - .. warning:: - - In `hunter 2.0` the default action will be :obj:`hunter.CallPrinter`. """ def __init__(self, *names, **options):
Remove bogus copypasted docstring.
ionelmc_python-hunter
train
py
7d68c9c0346ad11be5e98896bc057a502d32957e
diff --git a/js/coinmarketcap.js b/js/coinmarketcap.js index <HASH>..<HASH> 100644 --- a/js/coinmarketcap.js +++ b/js/coinmarketcap.js @@ -90,6 +90,7 @@ module.exports = class coinmarketcap extends Exchange { 'Bitgem': 'Bitgem', 'NetCoin': 'NetCoin', 'BatCoin': 'BatCoin', + 'iCoin': 'iCoin', }; if (name in currencies) return currencies[name];
coinmarketcap iCoin vs ICN conflict resolved
ccxt_ccxt
train
js
7e78e2a6731102d975b358138473cefcb38069c0
diff --git a/pulls/path_label.go b/pulls/path_label.go index <HASH>..<HASH> 100644 --- a/pulls/path_label.go +++ b/pulls/path_label.go @@ -24,6 +24,7 @@ import ( github_util "k8s.io/contrib/github" "k8s.io/contrib/mungegithub/config" + "k8s.io/kubernetes/pkg/util/sets" "github.com/golang/glog" "github.com/google/go-github/github" @@ -88,18 +89,18 @@ func (p *PathLabelMunger) MungePullRequest(config *config.MungeConfig, pr *githu } labelMap := *p.labelMap - needsLabels := []string{} + needsLabels := sets.NewString() for _, c := range commits { for _, f := range c.Files { for prefix, label := range labelMap { if strings.HasPrefix(*f.Filename, prefix) && !github_util.HasLabel(issue.Labels, label) { - needsLabels = append(needsLabels, label) + needsLabels.Insert(label) } } } } - if len(needsLabels) != 0 { - config.AddLabels(*pr.Number, needsLabels) + if needsLabels.Len() != 0 { + config.AddLabels(*pr.Number, needsLabels.List()) } }
Path labeler: Use a set instead of a list It prevents duplication. Doesn't really matter I guess.
kubernetes_test-infra
train
go
c0456b5950a4567d3d9c85fc9f163252ae6d90c8
diff --git a/install/checks/class.DatabaseDrivers.php b/install/checks/class.DatabaseDrivers.php index <HASH>..<HASH> 100644 --- a/install/checks/class.DatabaseDrivers.php +++ b/install/checks/class.DatabaseDrivers.php @@ -33,7 +33,6 @@ class tao_install_checks_DatabaseDrivers extends common_configuration_Component 'pdo_pgsql', 'pdo_sqlsrv', 'pdo_oci', - 'grpc' // spanner transport ]; foreach ($drivers as $d) {
list of drivers is going to be added to driver list in dedicated PR
oat-sa_tao-core
train
php
4d809c4f72c29cec4df5514aca3925c5bbc70c49
diff --git a/tests/test_client.py b/tests/test_client.py index <HASH>..<HASH> 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -130,7 +130,7 @@ def get_proxy(host, port, device, green_mode): return device_proxy_map[green_mode](access) -def wait_for_proxy(host, proc, device, green_mode, retries=200, delay=0.01): +def wait_for_proxy(host, proc, device, green_mode, retries=400, delay=0.01): for i in range(retries): ports = get_ports(proc.pid) if ports:
Increase test proxy startup timeout CI build failing on Python <I> unexpectedly. Trying a longer timeout to see it that fixes it.
tango-controls_pytango
train
py
738ccb8d543e4c25ab2bc5058fa841a05d66637e
diff --git a/svg-pan-zoom.js b/svg-pan-zoom.js index <HASH>..<HASH> 100644 --- a/svg-pan-zoom.js +++ b/svg-pan-zoom.js @@ -410,8 +410,8 @@ window.svgPanZoom = (function(document) { var newScale = Math.min(boundingClientRect.width/bBox.width, boundingClientRect.height/bBox.height); newCTM.a = newScale * oldCTM.a; //x-scale newCTM.d = newScale * oldCTM.d; //y-scale - newCTM.e = oldCTM.e * newScale - (boundingClientRect.width - bBox.width * newScale)/2 - bBox.x * newScale; //x-transform - newCTM.f = oldCTM.f * newScale - (boundingClientRect.height - bBox.height * newScale)/2 - bBox.y * newScale; //y-transform + newCTM.e = oldCTM.e * newScale + (boundingClientRect.width - bBox.width * newScale)/2 - bBox.x * newScale; //x-transform + newCTM.f = oldCTM.f * newScale + (boundingClientRect.height - bBox.height * newScale)/2 - bBox.y * newScale; //y-transform setCTM(viewport, newCTM); if (onZoom) { onZoom(newCTM.a); } });
Update svg-pan-zoom.js resetZoom didn't work if the boundingClientRect and the bbox were not squares
ariutta_svg-pan-zoom
train
js
2a1c572510135e692cbbcf6fc10498c3b79c0ff0
diff --git a/playground/scripts/unit.ios.js b/playground/scripts/unit.ios.js index <HASH>..<HASH> 100644 --- a/playground/scripts/unit.ios.js +++ b/playground/scripts/unit.ios.js @@ -12,11 +12,11 @@ function testProject() { -destination 'platform=iOS Simulator,name=iPhone SE' `; - if (hasXcpretty()) { - shellUtils.exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`); - } else { - shellUtils.exec.execSync(`${cmd}`); - } + // if (hasXcpretty()) { + // shellUtils.exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`); + // } else { + shellUtils.exec.execSync(`${cmd}`); + // } shellUtils.exec.execSync(`echo 'travis_fold:end:xcodeunit'`); } function hasXcpretty() {
disabled xcpretty to debug weird ios bug
wix_react-native-navigation
train
js
bff48b594f4714e0f2d52793a1a038ce1f436719
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name='edx-oauth2-provider', - version='0.5.4', + version='0.5.5', description='Provide OAuth2 access to edX installations', author='edX', url='https://github.com/edx/edx-oauth2-provider', @@ -18,7 +18,7 @@ setup( 'Programming Language :: Python', 'Framework :: Django', ], - packages=find_packages(exclude=['tests', '*.tests']), + packages=find_packages(exclude=['tests']), dependency_links=[ 'git+https://github.com/edx/[email protected]#egg=django-oauth2-provider-0.2.7-fork-edx-5', ],
Include oauth2-provider's tests module in the installed package
edx_edx-oauth2-provider
train
py
d61c30d8a1d2ed8b6144fadfd15ff476b1c9acbb
diff --git a/src/Handler/File.php b/src/Handler/File.php index <HASH>..<HASH> 100644 --- a/src/Handler/File.php +++ b/src/Handler/File.php @@ -52,7 +52,7 @@ class File extends AbstractHandler { if (file_put_contents( "{$this->path}{$name}.cache", - serialize($this->prepData($data, $maxAge)) + $this->prepData($data, $maxAge) ) === false ) { throw new WriteException("Error writting data to cache."); @@ -65,7 +65,7 @@ class File extends AbstractHandler */ public function exists(string $name): bool { - return file_exists("{$this->path}{$name}.cache") + return file_exists("{$this->path}{$name}.cache"); } /** @@ -73,6 +73,12 @@ class File extends AbstractHandler */ public function get(string $name): string { - return ""; + if ($this->exists($name) === false) { + throw new \SlaxWeb\Cache\Exception\CacheDataNotFoundException( + "The data you are trying to obtain does not exist." + ); + } + + return $this->checkData(file_get_contents("{$this->path}{$name}.cache"))["data"]; } }
retrieve, check and return data in the file handler
SlaxWeb_Cache
train
php
cdd8c230ecff93af3d957ccd38b4dbc1f0b0e6f9
diff --git a/kernel/content/action.php b/kernel/content/action.php index <HASH>..<HASH> 100644 --- a/kernel/content/action.php +++ b/kernel/content/action.php @@ -837,7 +837,6 @@ else if ( $module->isCurrentAction( 'RemoveAssignment' ) ) if ( $count > 0 ) { $hasChildren = true; - break; } unset( $node ); }
- Fixed bug on location removal form navigation mode, the list of removed locations would be shortened if the first items had children. git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
9bc0a4b3a5907baded58f93deeda925c45dd210f
diff --git a/src/js/server/handlebars.js b/src/js/server/handlebars.js index <HASH>..<HASH> 100644 --- a/src/js/server/handlebars.js +++ b/src/js/server/handlebars.js @@ -8,7 +8,7 @@ var fluid = fluid || require("infusion"); var gpii = fluid.registerNamespace("gpii"); fluid.registerNamespace("gpii.express.hb"); -var exphbs = require("express-handlebars"); +var exphbs = require("express-handlebars"); require("handlebars"); gpii.express.hb.addHelper = function (that, component) { diff --git a/src/js/server/md-server.js b/src/js/server/md-server.js index <HASH>..<HASH> 100644 --- a/src/js/server/md-server.js +++ b/src/js/server/md-server.js @@ -6,7 +6,7 @@ var fluid = fluid || require("infusion"); var gpii = fluid.registerNamespace("gpii"); fluid.registerNamespace("gpii.templates.hb.helper.md.server"); -var pagedown = require("pagedown"); +var pagedown = require("pagedown"); gpii.templates.hb.helper.md.server.initConverter = function (that) { var converter = pagedown.getSanitizingConverter();
Removed additional whitespace per pull request feedback.
GPII_gpii-handlebars
train
js,js
51229ea305d246ca2d0377aa439f67a29ce6e5c0
diff --git a/wily/commands/build.py b/wily/commands/build.py index <HASH>..<HASH> 100644 --- a/wily/commands/build.py +++ b/wily/commands/build.py @@ -72,7 +72,10 @@ def build(config, archiver, operators): bar.finish() except Exception as e: logger.error(f"Failed to build cache: '{e}'") - raise e + if logger.level == "DEBUG": + raise e + else: + logger.debug(logger.level) finally: # Reset the archive after every run back to the head of the branch archiver.finish()
rethrow on debug mode
tonybaloney_wily
train
py
ad305a890a9854f55b6da97d734f6e738a024066
diff --git a/cake/libs/folder.php b/cake/libs/folder.php index <HASH>..<HASH> 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -302,7 +302,7 @@ class Folder extends Object { * @static */ function addPathElement($path, $element) { - return Folder::slashTerm($path) . $element; + return rtrim($path, DS) . DS . $element; } /** * Returns true if the File is in a given CakePath.
Applying optimization from 'ermayer' Reduces functions called from Folder::addPathElement() Fixes #<I>
cakephp_cakephp
train
php
977390bd43433c22a226643e850b6fa4b80c5de9
diff --git a/galpy/orbit/Orbits.py b/galpy/orbit/Orbits.py index <HASH>..<HASH> 100644 --- a/galpy/orbit/Orbits.py +++ b/galpy/orbit/Orbits.py @@ -1107,6 +1107,8 @@ class Orbits(object): **orbSetupKwargs) out._roSet= self._roSet out._voSet= self._voSet + # Make sure the output has the same shape as the original Orbit + out.reshape(self.shape) return out @shapeDecorator
Make sure shape of flipped orbit is the same as that of the original orbit
jobovy_galpy
train
py
edccf2007b0ac0abd14c5ee1c2a52829c6f82cd7
diff --git a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskQueryServiceImpl.java b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskQueryServiceImpl.java index <HASH>..<HASH> 100644 --- a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskQueryServiceImpl.java +++ b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskQueryServiceImpl.java @@ -695,7 +695,8 @@ public class TaskQueryServiceImpl implements TaskQueryService { " t.taskData.processId,\n" + " t.taskData.processInstanceId,\n" + " t.taskData.parentId,\n" + - " t.taskData.deploymentId )\n"; + " t.taskData.deploymentId,\n" + + " t.taskData.skipable )\n"; public static String TASKSUMMARY_FROM = "FROM TaskImpl t,\n"
JBPM-<I> - Task queries do not set skipable on TaskSummary instance
kiegroup_jbpm
train
java
a6604ba8c7c8837ba9385dedd97e4b519a796226
diff --git a/lib/percheron/container/main.rb b/lib/percheron/container/main.rb index <HASH>..<HASH> 100644 --- a/lib/percheron/container/main.rb +++ b/lib/percheron/container/main.rb @@ -20,17 +20,6 @@ module Percheron self end - def stop! - Container::Actions::Stop.new(self).execute! - rescue Errors::ContainerNotRunning - $logger.debug "Container '#{name}' is not running" - end - - def start! - Container::Actions::Create.new(self).execute! unless exists? - Container::Actions::Start.new(self).execute! - end - def id exists? ? info.id[0...12] : 'N/A' end @@ -70,6 +59,17 @@ module Percheron Container::Null.new end + def stop! + Container::Actions::Stop.new(self).execute! + rescue Errors::ContainerNotRunning + $logger.debug "Container '#{name}' is not running" + end + + def start! + Container::Actions::Create.new(self).execute! unless exists? + Container::Actions::Start.new(self).execute! + end + def recreate? could_rebuild? && (version > built_version) && auto_recreate? end
Moved Container::Main#stop!/start! around a bit
ashmckenzie_percheron
train
rb
93b879f471754528b9b0e4340e56cd572c86ff17
diff --git a/src/main/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesAnotB.java b/src/main/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesAnotB.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesAnotB.java +++ b/src/main/java/com/yahoo/sketches/tuple/HeapArrayOfDoublesAnotB.java @@ -107,7 +107,7 @@ public class HeapArrayOfDoublesAnotB extends ArrayOfDoublesAnotB { return result; } - private long[] convertToHashTable(ArrayOfDoublesSketch sketch) { + private static long[] convertToHashTable(ArrayOfDoublesSketch sketch) { int size = Math.max( ceilingPowerOf2((int) Math.ceil(sketch.getRetainedEntries() / REBUILD_THRESHOLD)), ArrayOfDoublesQuickSelectSketch.MIN_NOM_ENTRIES
Changed HeapArrayOfDoublesAnotB.convertToHashTable(ArrayOfDoublesSketch sketch) to static.
DataSketches_sketches-core
train
java
715184adc3668b6fe724462e4e2fb93b7297b696
diff --git a/src/Shibalike/Util/UserlandSession.php b/src/Shibalike/Util/UserlandSession.php index <HASH>..<HASH> 100644 --- a/src/Shibalike/Util/UserlandSession.php +++ b/src/Shibalike/Util/UserlandSession.php @@ -24,6 +24,8 @@ use Shibalike\Util\UserlandSession\Storage\Files; * this class in tandem with native sessions. * * Also a tiny session fixation vulnerability has been prevented in start(). + * + * @see http://svn.php.net/viewvc/php/php-src/trunk/ext/session/session.c?view=markup */ class UserlandSession { const CACHE_LIMITER_NONE = '';
Added link to native PHP session.c
mrclay_UserlandSession
train
php
c33fc77dee0253d5de9d83ea52f4def34d3523e2
diff --git a/src/authnet/AuthnetJsonRequest.php b/src/authnet/AuthnetJsonRequest.php index <HASH>..<HASH> 100644 --- a/src/authnet/AuthnetJsonRequest.php +++ b/src/authnet/AuthnetJsonRequest.php @@ -171,12 +171,9 @@ class AuthnetJsonRequest } /** - * Tells the handler to make the API call to Authorize.Net - * - * @return string JSON string containing API response - * @throws AuthnetCurlException + * Makes POST request with retry logic. */ - private function process() : string + private function makeRequest() : void { $retries = 0; while ($retries < self::MAX_RETRIES) { @@ -186,6 +183,17 @@ class AuthnetJsonRequest } $retries++; } + } + + /** + * Tells the handler to make the API call to Authorize.Net + * + * @return string JSON string containing API response + * @throws AuthnetCurlException + */ + private function process() : string + { + $this->makeRequest(); if (!$this->processor->error && isset($this->processor->response)) { return $this->processor->response; }
Reduced complexity of AuthnetJsonRequest::process() by breaking out request and retry logic into its own method
stymiee_authnetjson
train
php
aadbc7ae36aac17a9a5b6018a475d7032084a985
diff --git a/src/MediaBundle/Repository/MediaDirectoryRepository.php b/src/MediaBundle/Repository/MediaDirectoryRepository.php index <HASH>..<HASH> 100644 --- a/src/MediaBundle/Repository/MediaDirectoryRepository.php +++ b/src/MediaBundle/Repository/MediaDirectoryRepository.php @@ -18,15 +18,14 @@ class MediaDirectoryRepository extends EntityRepository $qb = $this->createQueryBuilder('d'); if ($dir) { - return $qb->leftJoin('d.parent', 'parent') + $query = $qb->leftJoin('d.parent', 'parent') ->where('parent.id = :parent') - ->setParameter('parent', $dir) - ->addOrderBy('createdAt', 'DESC') - ->getQuery() - ->getResult(); + ->setParameter('parent', $dir); + } else { + $query = $qb->where('d.parent IS NULL'); } - return $qb->where('d.parent IS NULL') + return $query->addOrderBy('createdAt', 'DESC') ->getQuery() ->getResult(); }
Added sort on newest to the no directory query
Opifer_Cms
train
php
09639ceb967dc027fb61f699a6a89247d2249357
diff --git a/src/web/server.js b/src/web/server.js index <HASH>..<HASH> 100644 --- a/src/web/server.js +++ b/src/web/server.js @@ -237,7 +237,7 @@ module.exports = class Server extends mix(Emitter) { }; this._render(match.route.view, context) - .then(v => res.send(v).end()) + .then(v => res.send(v)) .catch(err => next(err)); } @@ -251,7 +251,7 @@ module.exports = class Server extends mix(Emitter) { } this._render(this._theme.errorView(), { error: err }) - .then(v => res.send(v).end()) + .then(v => res.send(v)) .catch(err => next(err)); this.emit('error', err, res.locals.__request);
fix: remove end from server rendering (#<I>)
frctl_fractal
train
js
66097ea2e83a6bb8a2b73012d6f33509d427c62e
diff --git a/lib/fortitude/widget.rb b/lib/fortitude/widget.rb index <HASH>..<HASH> 100644 --- a/lib/fortitude/widget.rb +++ b/lib/fortitude/widget.rb @@ -179,46 +179,6 @@ EOS rebuild_run_content! -=begin - Grandparent declares: - around_content :gp1 - around_content :gp2 - - Parent declares: - around_content :p1 - around_content :p2 - - Child declares: - around_content :c1 - around_content :c2 - - What should run: - gp1 { - gp2 { - p1 { - p2 { - c1 { - c2 { - content - } - } - } - } - } - } - - How to do this: - - each class collects all filters declared - - each class defines run_content, that runs content with all those filters - - you *never* call super from run_content - - we start with: - def run_content(&block) - content(&block) - end - ...so that even with no around_content filters, it works -=end - - def to_html(rendering_context) @_fortitude_rendering_context = rendering_context @_fortitude_output = rendering_context.output
Remove no-longer-needed comment.
ageweke_fortitude
train
rb
5e70a794d20ae02a998e3567a74100a96719a295
diff --git a/eureka-client/src/main/java/com/netflix/discovery/InstanceInfoReplicator.java b/eureka-client/src/main/java/com/netflix/discovery/InstanceInfoReplicator.java index <HASH>..<HASH> 100644 --- a/eureka-client/src/main/java/com/netflix/discovery/InstanceInfoReplicator.java +++ b/eureka-client/src/main/java/com/netflix/discovery/InstanceInfoReplicator.java @@ -67,7 +67,7 @@ class InstanceInfoReplicator implements Runnable { } public void stop() { - scheduler.shutdown(); + scheduler.shutdownNow(); started.set(false); }
Terminate instanceInfoReplicator with shutdownNow() instead of shutdown()
Netflix_eureka
train
java
0a90c153360c51816c94497dd2064cc3aecb730a
diff --git a/src/core/TextFontMetrics.js b/src/core/TextFontMetrics.js index <HASH>..<HASH> 100644 --- a/src/core/TextFontMetrics.js +++ b/src/core/TextFontMetrics.js @@ -66,6 +66,10 @@ function clearCanvas() { } function calcTextAdvanceCanvas(text, fontSize, font) { + // need to override newline handling, measureText doesn't handle it correctly (returns a non-zero width) + if(text === '\n') { + return 0 + } let context = canvasContext() context.font = fontSpec(fontSize, font) return context.measureText(text).width
Fix non-zero width in canvas-based measurement of newline chars
ritzyed_ritzy
train
js
e0b15b7a539196abf47086e3757ddc1a913d958f
diff --git a/tests/test_hosts.py b/tests/test_hosts.py index <HASH>..<HASH> 100644 --- a/tests/test_hosts.py +++ b/tests/test_hosts.py @@ -65,7 +65,7 @@ def test_existing_ipv6_addresses_are_preserved(tmpdir): TBC """ hosts_file = tmpdir.mkdir("etc").join("hosts") - hosts_file.write("fe80::1%lo0\tlocalhost\n6.6.6.6\texample.com\n# A test comment\n\n") + hosts_file.write("fe80::1\tlocalhost\n6.6.6.6\texample.com\n# A test comment\n\n") hosts = Hosts(path=hosts_file.strpath) new_entry = HostsEntry(entry_type='ipv4', address='82.132.132.132', names=['something.com', 'example']) hosts.add(entries=[new_entry], force=False)
try different format of ipv6 address to see if it fixes travis test.
jonhadfield_python-hosts
train
py
2a3f759eef10352bedce5f13b12dbdda30aacab2
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -191,7 +191,7 @@ module Rails def web_server_gemfile_entry # :doc: return [] if options[:skip_puma] comment = "Use Puma as the app server" - GemfileEntry.new("puma", "~> 3.11", comment) + GemfileEntry.new("puma", "~> 4.1", comment) end def include_all_railties? # :doc: diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index <HASH>..<HASH> 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -597,7 +597,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_generator_defaults_to_puma_version run_generator [destination_root] - assert_gem "puma", "'~> 3.11'" + assert_gem "puma", "'~> 4.1'" end def test_generator_if_skip_puma_is_given
Generate new apps with latest puma version
rails_rails
train
rb,rb
66b23022c0a843de26a2824516ab097c07dfc722
diff --git a/test/context_test.py b/test/context_test.py index <HASH>..<HASH> 100644 --- a/test/context_test.py +++ b/test/context_test.py @@ -125,8 +125,6 @@ class ContextTest(unittest.TestCase): } ctx = Context(**obj) ctx2 = ctx.as_version() - print ctx2 - print check_obj self.assertEqual(ctx2, check_obj) def ctxVerificationHelper(self, ctx):
finished the punishing (removed print statements)
RusticiSoftware_TinCanPython
train
py