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
fcc23220c70b256c770ca6e7da139e47f8e3a098
diff --git a/src/components/AvMedia.js b/src/components/AvMedia.js index <HASH>..<HASH> 100644 --- a/src/components/AvMedia.js +++ b/src/components/AvMedia.js @@ -113,6 +113,16 @@ const props = { lineWidth: { type: Number, default: null + }, + + /** + * prop: 'connect-distination' + * Analyser to connect to audio context's destination + * Default: true + */ + connectDistination: { + type: Boolean, + default: true } } @@ -166,7 +176,9 @@ const AvMedia = { } else { this.analyser.fftSize = this.type === 'frequ' ? 1024 : 8192 } - this.analyser.connect(this.audioCtx.destination) + if (this.connectDistination) { + this.analyser.connect(this.audioCtx.destination) + } }, draw: function () {
add connect-distination property to AvMedia
staskobzar_vue-audio-visual
train
js
295dd54057f11ea52cdda5d402c1796cd657e7bc
diff --git a/lib/travis/cli/api_command.rb b/lib/travis/cli/api_command.rb index <HASH>..<HASH> 100644 --- a/lib/travis/cli/api_command.rb +++ b/lib/travis/cli/api_command.rb @@ -34,13 +34,15 @@ module Travis on('--adapter ADAPTER', 'Faraday adapter to use for HTTP requests. If omitted, use Typhoeus if it is installed, ' \ 'and Net::HTTP otherwise. See https://lostisland.github.io/faraday/adapters/ for more info') do |c, adapter| - adapter.gsub! '-', '_' - require "faraday/adapter/#{adapter}" - require 'typhoeus/adapters/faraday' if adapter == 'typhoeus' - c.session.faraday_adapter = adapter.to_sym - rescue LoadError => e - warn "\`--adapter #{adapter}\` is given, but it is not installed. Run \`gem install #{adapter}\` and try again" - exit 1 + begin + adapter.gsub! '-', '_' + require "faraday/adapter/#{adapter}" + require 'typhoeus/adapters/faraday' if adapter == 'typhoeus' + c.session.faraday_adapter = adapter.to_sym + rescue LoadError => e + warn "\`--adapter #{adapter}\` is given, but it is not installed. Run \`gem install #{adapter}\` and try again" + exit 1 + end end def initialize(*)
Wrap `rescue` in `begin; end` block For Ruby < <I> compatibility
travis-ci_travis.rb
train
rb
223e194e173007c6d047e409da3f8dde9121f5ed
diff --git a/liquibase-core/src/main/java/liquibase/changelog/StandardChangeLogHistoryService.java b/liquibase-core/src/main/java/liquibase/changelog/StandardChangeLogHistoryService.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/changelog/StandardChangeLogHistoryService.java +++ b/liquibase-core/src/main/java/liquibase/changelog/StandardChangeLogHistoryService.java @@ -70,6 +70,7 @@ public class StandardChangeLogHistoryService extends AbstractChangeLogHistorySer public void reset() { this.ranChangeSetList = null; this.serviceInitialized = false; + this.hasDatabaseChangeLogTable = null; } public boolean hasDatabaseChangeLogTable() throws DatabaseException {
CORE-<I> StandardChangeLogHistoryService.hasDatabaseChangeLogTable value is cached too aggressively
liquibase_liquibase
train
java
52d617179da75e6bab706a5db928600aa7df2522
diff --git a/spec/rubocop/cop/style/class_methods_spec.rb b/spec/rubocop/cop/style/class_methods_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/cop/style/class_methods_spec.rb +++ b/spec/rubocop/cop/style/class_methods_spec.rb @@ -43,7 +43,7 @@ describe Rubocop::Cop::Style::ClassMethods do it 'does not register an offense outside class/module bodies' do inspect_source(cop, - ['def self.some_method', + ['def Test.some_method', ' do_something', 'end']) expect(cop.offenses).to be_empty
proper failing test case for ClassMethods
rubocop-hq_rubocop
train
rb
af10844d2034f21555d9dfa78a5bffbd9a63688f
diff --git a/lib/consumers/amqp.js b/lib/consumers/amqp.js index <HASH>..<HASH> 100644 --- a/lib/consumers/amqp.js +++ b/lib/consumers/amqp.js @@ -70,7 +70,7 @@ Consumer.prototype.consume = function (socket, data) { if (!_.isUndefined(data.id) && _.isString(data.id)) { // this consume request is hinting at sharing the event workload with other clients (by specifying an explicit id). // allow clients with the same id and routingKey to bind to the same amqp queue - var queueName = data.id.replace(/[\W-]/g, '').trim(); + var queueName = data.id.replace(/[^\w-]/g, '').trim(); if (queueName) { options.queue.name = 'shared-' + data.routingKey.replace(/\W/g, '') + '-' + queueName;
fix queue name sanitization regexp
sazze_node-eventsd-server
train
js
e823d621d073b0faceb7fcbcbe16740fdc2e8c14
diff --git a/gspread/client.py b/gspread/client.py index <HASH>..<HASH> 100644 --- a/gspread/client.py +++ b/gspread/client.py @@ -218,8 +218,8 @@ class Client(object): try: r = self.session.put(url, data, headers=headers) except RequestError as ex: - if ex[0] == 403: - raise UpdateCellError(ex[1]) + if ex.args[0] == 403: + raise UpdateCellError(ex.args[1]) else: raise
`Exception` does not support indexing.
burnash_gspread
train
py
5eac44bea57997a0d1efb1ff29cc2a913f653145
diff --git a/pypuppetdb/api/v3.py b/pypuppetdb/api/v3.py index <HASH>..<HASH> 100644 --- a/pypuppetdb/api/v3.py +++ b/pypuppetdb/api/v3.py @@ -100,6 +100,9 @@ class API(BaseAPI): except AttributeError: node['status'] = 'unreported' + if not node['report_timestamp']: + node['status'] = 'unreported' + if not with_status: node['status'] = None
fix for status without report timestamp nodes without a report timestamp will status unreported pep8 fix
voxpupuli_pypuppetdb
train
py
6facfe275cce431bbc3b6b4cb3896f707d35c4fd
diff --git a/lib/ruby-lint/iterator.rb b/lib/ruby-lint/iterator.rb index <HASH>..<HASH> 100644 --- a/lib/ruby-lint/iterator.rb +++ b/lib/ruby-lint/iterator.rb @@ -104,7 +104,13 @@ module RubyLint # @param [Array] args Arguments to pass to the callback method. # def execute_callback(name, *args) - send(name, *args) if respond_to?(name) + return unless respond_to?(name) + + if method(name).arity == 0 + send(name) + else + send(name, *args) + end end ## diff --git a/spec/ruby-lint/iterator_spec.rb b/spec/ruby-lint/iterator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ruby-lint/iterator_spec.rb +++ b/spec/ruby-lint/iterator_spec.rb @@ -133,4 +133,19 @@ end iterator.options[:module].should == true iterator.options[:class].should == false end + + example 'allow callbacks without arguments' do + ast = parse('10', false) + iterator = Class.new(RubyLint::Iterator) do + attr_reader :number + + def on_int + @number = true + end + end.new + + iterator.iterate(ast) + + iterator.number.should == true + end end
Allow iterator callbacks without arguments. This means that callback methods (e.g. `on_int`) don't have to specify unused method arguments.
YorickPeterse_ruby-lint
train
rb,rb
b2d087f3c2357ea1b269276bc7635e49d084d380
diff --git a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WHeading.java b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WHeading.java index <HASH>..<HASH> 100755 --- a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WHeading.java +++ b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WHeading.java @@ -1,5 +1,7 @@ package com.github.bordertech.wcomponents; +import java.util.List; + /** * This component is used to render the different types of headings within an application. * @@ -235,6 +237,14 @@ public class WHeading extends WText implements Container, AjaxTarget, Marginable } /** + * {@inheritDoc} + */ + @Override + public List<WComponent> getChildren() { + return super.getChildren(); + } + + /** * @return a String representation of this component, for debugging purposes. */ @Override
Add getChildren() to Container API
BorderTech_wcomponents
train
java
b33b5be8a86174c67031138ebf5ac9f51f967ea5
diff --git a/lib/l20n.js b/lib/l20n.js index <HASH>..<HASH> 100644 --- a/lib/l20n.js +++ b/lib/l20n.js @@ -106,6 +106,9 @@ loadURIs(uris).then(function() { var res = new Resource(uri); res.ast = mParser.parse(source).body; + for (imp in imports) { + res.resources.push(loadResource(imp.uri, sync, depth=1); + } deferred.resolve(res); } return deferred.promise;
WIP3 - make imports WIP
l20n_l20n.js
train
js
d48c8ca8de34765b714025ad3fdc6fcb83ef0364
diff --git a/actstream/gfk.py b/actstream/gfk.py index <HASH>..<HASH> 100644 --- a/actstream/gfk.py +++ b/actstream/gfk.py @@ -54,6 +54,7 @@ class GFKQuerySet(QuerySet): for gfk in gfk_fields: ct_id_field = self.model._meta.get_field(gfk.ct_field).column if getattr(item, ct_id_field) is None: continue + if getattr(item, gfk.fk_field) is None: continue ct_map.setdefault(getattr(item, ct_id_field), {} )[smart_unicode(getattr(item, gfk.fk_field))] = (gfk.name, item.pk)
Ignoring corrupted GFK values (one of CType or ID is None)
justquick_django-activity-stream
train
py
78820a63d647276cf17dac9ac71ed2beb19f285d
diff --git a/daemon/daemon.go b/daemon/daemon.go index <HASH>..<HASH> 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -542,7 +542,7 @@ func (daemon *Daemon) reserveName(id, name string) (string, error) { } else { nameAsKnownByUser := strings.TrimPrefix(name, "/") return "", fmt.Errorf( - "Conflict. The name %q is already in use by container %s. You have to delete that container to be able to reuse that name.", nameAsKnownByUser, + "Conflict. The name %q is already in use by container %s. You have to delete (or rename) that container to be able to reuse that name.", nameAsKnownByUser, utils.TruncateID(conflictingContainer.ID)) } }
Mention "or rename" again in error-message. The "or rename" part was removed from the error-message, because renaming wasn't possible at the time. Now that <URL>
moby_moby
train
go
aa22d0ec958d4635454e16bf39cf466d37a534f3
diff --git a/tests/test_unpack.py b/tests/test_unpack.py index <HASH>..<HASH> 100644 --- a/tests/test_unpack.py +++ b/tests/test_unpack.py @@ -66,6 +66,10 @@ def test_unpack(): print c assert np.allclose(b, c) + # Test 8-bit! + c = unpack(a, 8) + assert np.allclose(a, c) + if __name__ == "__main__": test_1to8() test_2to8()
utils.py coverage now at <I>%
UCBerkeleySETI_blimpy
train
py
fee538e20a50445db398e242e2377883f3a621b8
diff --git a/distutilazy/test.py b/distutilazy/test.py index <HASH>..<HASH> 100644 --- a/distutilazy/test.py +++ b/distutilazy/test.py @@ -17,7 +17,7 @@ from importlib import import_module import unittest from distutils.core import Command -__version__ = "0.2.0" +__version__ = "0.3.0" def test_suite_for_modules(modules): @@ -176,5 +176,4 @@ class RunTests(Command): self.announce("running tests ...") runner.run(suite) - -run_tests = RunTests +run_tests = RunTests \ No newline at end of file diff --git a/tests/test_test.py b/tests/test_test.py index <HASH>..<HASH> 100755 --- a/tests/test_test.py +++ b/tests/test_test.py @@ -69,9 +69,9 @@ class TestTest(TestCase): def test_get_test_runner(self): dist = Distribution() - test_ = RunTests(dist) - test_.finalize_options() - runner = test_.get_test_runner() + test_runner = RunTests(dist) + test_runner.finalize_options() + runner = test_runner.get_test_runner() self.assertTrue(hasattr(runner, 'run')) self.assertTrue(hasattr(runner.run, '__call__'))
Increase the version of test runner module, some more clearing up
farzadghanei_distutilazy
train
py,py
52921e2d5f3fe2be610294a85fb6a3f46a931950
diff --git a/packages/dai-plugin-governance/test/GovPollingService.test.js b/packages/dai-plugin-governance/test/GovPollingService.test.js index <HASH>..<HASH> 100644 --- a/packages/dai-plugin-governance/test/GovPollingService.test.js +++ b/packages/dai-plugin-governance/test/GovPollingService.test.js @@ -72,7 +72,7 @@ test('can create poll', async () => { expect(secondPollId).toBe(firstPollId + 1); }); -test.only('can vote', async () => { +test('can vote', async () => { const POLL_ID = [0]; const OPTION_ID = [3]; const txo = await govPollingService.vote(POLL_ID, OPTION_ID); @@ -81,7 +81,7 @@ test.only('can vote', async () => { expect(loggedOptionId).toBe(OPTION_ID[0]); }); -test.only('can vote in batches', async () => { +test('can vote in batches', async () => { const POLL_IDS = [0, 1]; const OPTION_IDS = [3, 4]; const txo = await govPollingService.vote(POLL_IDS, OPTION_IDS);
rmv test.only from polling tests
makerdao_dai.js
train
js
812cff004eeb7235206bc30aa8175a7310c19a78
diff --git a/src/main/java/com/codeborne/selenide/WebDriverRunner.java b/src/main/java/com/codeborne/selenide/WebDriverRunner.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/codeborne/selenide/WebDriverRunner.java +++ b/src/main/java/com/codeborne/selenide/WebDriverRunner.java @@ -130,8 +130,6 @@ public class WebDriverRunner { } catch (Exception e) { System.err.println(e); } - } else { - System.err.println("Cannot take screenshot, driver does not support it: " + webdriver); } return targetFile.getAbsolutePath();
Removed annoying log "Cannot take screenshot, driver does not support it"
selenide_selenide
train
java
7d21f02b9ec9f655583e898350badf89165ed4d5
diff --git a/src/event.js b/src/event.js index <HASH>..<HASH> 100644 --- a/src/event.js +++ b/src/event.js @@ -615,6 +615,8 @@ jQuery.each( { clientY: true, offsetX: true, offsetY: true, + pointerId: true, + pointerType: true, screenX: true, screenY: true, targetTouches: true,
Event: Add the most commonly used pointer event properties Ref gh-<I> Close gh-<I>
jquery_jquery
train
js
f1ba4993de0c905ac3c1a26e512a215256bb327c
diff --git a/geminipy.py b/geminipy.py index <HASH>..<HASH> 100644 --- a/geminipy.py +++ b/geminipy.py @@ -1,4 +1,3 @@ -import json import requests class geminipy: @@ -18,21 +17,13 @@ class geminipy: return response.content def book(self, symbol = "btcusd", limit_bids = 0, limit_asks = 0): - if symbol == "": - return "Error: No symbol specified" - url = self.base_url + '/v1/book/' + symbol params = {'limit_bids':limit_bids,'limit_asks':limit_asks} response = requests.get(url, params) return response.content def trades(self, symbol = "btcusd", since = 0, limit_trades = 50, include_breaks = 0): - if symbol == "": - return "Error: No symbol specified" - url = self.base_url + '/v1/trades/' + symbol params = {'since':since,'limit_trades':limit_trades,'include_breaks':include_breaks} response = requests.get(url, params) return response.content - -
removed basic validation for the 'symbol' argument since the API will handle it.. also added a default value
geminipy_geminipy
train
py
a417fa9d509ecea8c91405f9c569e8409affa34f
diff --git a/lib/forgetSQL.py b/lib/forgetSQL.py index <HASH>..<HASH> 100755 --- a/lib/forgetSQL.py +++ b/lib/forgetSQL.py @@ -7,6 +7,11 @@ ## http://forgetsql.sourceforge.net/ ## $Log$ +## Revision 1.11 2004/03/03 13:44:33 stain +## DateTimeDelta objects were stringified as +## '14:00:00:00.0' for 14 days, and PostgreSQL didn't like that. +## Changed to more approriate '14 00:00:00.0'. +## ## Revision 1.10 2003/10/08 14:53:48 stain ## self._new forces saveDB ## @@ -728,11 +733,15 @@ My fields: %s""" % (selectfields, cls._sqlFields) for field in fields: value = getattr(self, field) # First some dirty datatype hacks - if DateTime and type(value) in \ - (DateTime.DateTimeType, DateTime.DateTimeDeltaType): + if DateTime and type(value) == DateTime.DateTimeType: # stupid psycopg does not support it's own return type.. # lovely.. value = str(value) + if DateTime and type(value) == DateTime.DateTimeDeltaType: + # Format delta as days, hours, minutes seconds + # NOTE: includes value.second directly to get the + # whole floating number + value = value.strftime("%d %H:%M:") + str(value.second) if value is True or value is False: # We must store booleans as 't' and 'f' ... value = value and 't' or 'f'
DateTimeDelta objects were stringified as '<I>:<I>:<I>:<I>' for <I> days, and PostgreSQL didn't like that. Changed to more approriate '<I> <I>:<I>:<I>'.
stain_forgetSQL
train
py
1c19908e0766e524e83f24360abd630c279f7cf7
diff --git a/PyMata/pymata.py b/PyMata/pymata.py index <HASH>..<HASH> 100644 --- a/PyMata/pymata.py +++ b/PyMata/pymata.py @@ -121,7 +121,7 @@ class PyMata: if self.verbose: print("\nPython Version %s" % sys.version) - print('\nPyMata version 2.07 Copyright(C) 2013-15 Alan Yorinks All rights reserved.') + print('\nPyMata version 2.07a Copyright(C) 2013-15 Alan Yorinks All rights reserved.') # Instantiate the serial support class self.transport = PyMataSerial(port_id, self.command_deque) @@ -483,7 +483,7 @@ class PyMata: @return: """ - return [2, 07] + return ['2', '07a'] # noinspection PyMethodMayBeStatic
Changed PyMata Version to '<I>a'
MrYsLab_PyMata
train
py
582f5b067cbe70866c3066006de0e0b9d9ccf7e2
diff --git a/lib/container.js b/lib/container.js index <HASH>..<HASH> 100644 --- a/lib/container.js +++ b/lib/container.js @@ -160,6 +160,7 @@ module.exports = function(config, logger) { var instance = data.Instances[0]; var tagParams = {Resources: [instance.InstanceId], Tags: container.specific.tags}; + tagParams.Tags.push({Key: 'nscale-system', Value: system.name}); _ec2.createTags(tagParams, function() { pollInstanceStart(_ec2, instance, function(err, newSpecific) { if (err) { return cb(err); }
added nscale-system tag on boot
nearform_aws-ami-container
train
js
272e77ecece579b12447360fd2e2309b31a7c3dd
diff --git a/app/models/alchemy/message.rb b/app/models/alchemy/message.rb index <HASH>..<HASH> 100644 --- a/app/models/alchemy/message.rb +++ b/app/models/alchemy/message.rb @@ -11,11 +11,9 @@ module Alchemy class Message - extend ::ActiveModel::Naming include ::ActiveModel::Validations include ::ActiveModel::Conversion - include ::ActiveModel::MassAssignmentSecurity class << self def attr_accessor(*vars)
Removes MassAssigmentSecurity from Message model.
AlchemyCMS_alchemy_cms
train
rb
24021a4d7a63909f1cfb9c05f6e7a8af9cf75fe0
diff --git a/test/test_gscholar.py b/test/test_gscholar.py index <HASH>..<HASH> 100644 --- a/test/test_gscholar.py +++ b/test/test_gscholar.py @@ -2,12 +2,19 @@ # coding: utf8 import unittest +import time +import random from gscholar import gscholar as gs class TestGScholar(unittest.TestCase): + def tearDown(self): + # wait 1-2 seconds between tests, so we don't hammer google's + # servers and get banned. + time.sleep(random.uniform(1, 2)) + def test_query(self): """Normal query with latin encoding should give non empty result.""" result = gs.query('Albert Einstein', gs.FORMAT_BIBTEX)
Added delay between tests. Google banned me from google scholar on most of my machines already. (Sorry Google!)
venthur_gscholar
train
py
35344d4ab8b494aa8d8c0b4c393a52a19203917c
diff --git a/docker/Dockerfile.py b/docker/Dockerfile.py index <HASH>..<HASH> 100644 --- a/docker/Dockerfile.py +++ b/docker/Dockerfile.py @@ -24,7 +24,6 @@ dependencies = ' '.join(['libffi-dev', # For client side encryption for 'azure' 'python3.6', 'python3.6-dev', 'python-dev', # For installing Python packages with native code - 'python3-dev', 'python-pip', # Bootstrap pip, but needs upgrading, see below 'python3-pip', 'libcurl4-openssl-dev',
Drop python3-dev since we have python<I>-dev which conflicts
DataBiosphere_toil
train
py
c290b435ee7eb96862a11522284abcd1dfc0e1bd
diff --git a/django_plotly_dash/dash_wrapper.py b/django_plotly_dash/dash_wrapper.py index <HASH>..<HASH> 100644 --- a/django_plotly_dash/dash_wrapper.py +++ b/django_plotly_dash/dash_wrapper.py @@ -1,4 +1,5 @@ -'''dash_wrapper +''' +dash_wrapper This module provides a DjangoDash class that can be used to expose a Plotly Dasb application through a Django server @@ -420,4 +421,7 @@ class WrappedDash(Dash): The content returned from this function is injected unescaped into templates. ''' - return 'class="django-plotly-dash django-plotly-dash-iframe"' + pre_slugified_id = self._uid + slugified_id = slugify(pre_slugified_id) + + return 'class="django-plotly-dash django-plotly-dash-iframe django-plotly-dash-app-%s"' % slugified_id
First cut, with css classes based on app name
GibbsConsulting_django-plotly-dash
train
py
89a65a40294f8248203743d820aef09d767564ec
diff --git a/lib/badge.js b/lib/badge.js index <HASH>..<HASH> 100644 --- a/lib/badge.js +++ b/lib/badge.js @@ -7,7 +7,7 @@ const pad = 8; // left / right padding const sep = 4; // middle separation export default function badge({ total, active }){ - let value = active ? `${active}/${total}` : (total || '–'); + let value = active ? `${active}/${total}` : ('' + total || '–'); let lw = pad + width(title) + sep; // left side width let rw = sep + width(value) + pad; // right side width let tw = lw + rw; // total width @@ -34,5 +34,5 @@ function text({str, x, y}){ // π=3 function width(str){ - return 7 * String(str).length; + return 7 * str.length; }
this is better apparently '' + number is (a lot) faster than String(number) or number.toString(): <URL>
rauchg_slackin
train
js
cccf790f479b3a997a301a7ae75581a2bd5294a4
diff --git a/public/rcm-page-admin/plugin-drag.js b/public/rcm-page-admin/plugin-drag.js index <HASH>..<HASH> 100644 --- a/public/rcm-page-admin/plugin-drag.js +++ b/public/rcm-page-admin/plugin-drag.js @@ -28,12 +28,16 @@ var RcmPluginDrag = { } } ); - for (var i = 0; i < extraRowCount; i++) { - //do not add extra row at the bottom of GuestTopNav, causes issues - if (container.attr('data-singleRowOnly') != 'Y') { - container.append($('<div class="row"></div>')); + $.each( + container, function () { + for (var i = 0; i < extraRowCount; i++) { + //do not add extra row at the bottom of GuestTopNav, causes issues + if ($(this).closest('[singlerowonly]').length == 0) { + container.append($('<div class="row"></div>')); + } + } } - } + ); } ); },
Merge remote-tracking branch 'upstream/master' into responsiveThemefix # Conflicts: # composer.lock
reliv_Rcm
train
js
70293d3adb5d5fd6c841171c7120a338d583c4e7
diff --git a/dist/angularJsOAuth2.js b/dist/angularJsOAuth2.js index <HASH>..<HASH> 100755 --- a/dist/angularJsOAuth2.js +++ b/dist/angularJsOAuth2.js @@ -245,8 +245,8 @@ signOutUrl: '@', // url on the authorization server for logging out. Local token is deleted even if no URL is given but that will leave user logged in against STS signOutAppendToken: '@', // defaults to 'false', set to 'true' to append the token to the sign out url signOutRedirectUrl: '@', // url to redirect to after sign out on the STS has completed - nonce: '@', // nonce value, optional. If unspecified or an empty string and autoGenerateNonce is true then a nonce will be auto-generated - autoGenerateNonce: '=' // Should a nonce be autogenerated if not supplied. Optional and defaults to true. + nonce: '@?', // nonce value, optional. If unspecified or an empty string and autoGenerateNonce is true then a nonce will be auto-generated + autoGenerateNonce: '=?' // Should a nonce be autogenerated if not supplied. Optional and defaults to true. } };
Made nonce and autoGenerateNonce optional, like the comments suggests they are.
JamesRandall_AngularJS-OAuth2
train
js
427183b6a6cd17bb7333e1ac1fb6a58601e9b359
diff --git a/bosh-director-core/lib/bosh/director/core/templates/job_template_renderer.rb b/bosh-director-core/lib/bosh/director/core/templates/job_template_renderer.rb index <HASH>..<HASH> 100644 --- a/bosh-director-core/lib/bosh/director/core/templates/job_template_renderer.rb +++ b/bosh-director-core/lib/bosh/director/core/templates/job_template_renderer.rb @@ -62,7 +62,9 @@ module Bosh::Director::Core::Templates # Make a deep copy of the spec and replace the properties with # the specific template properties. altered_spec = Bosh::Common::DeepCopy.copy(spec) - altered_spec['properties'] = current_template['template_scoped_properties'] + altered_spec['properties'] = Bosh::Common::DeepCopy.copy( + current_template['template_scoped_properties'] + ) result = altered_spec end end
allow specifying properties on a job in the deployment manifest Make a deep copy of a variable to avoid weird errors [#<I>] <URL>
cloudfoundry_bosh
train
rb
a53163d373f605e9cb65243f057b0470230e357c
diff --git a/spec/high_level_spec.rb b/spec/high_level_spec.rb index <HASH>..<HASH> 100644 --- a/spec/high_level_spec.rb +++ b/spec/high_level_spec.rb @@ -35,8 +35,10 @@ describe "RR" do subject.first(1).second(2).third(3).should == 4 mock(subject).first(1) {mock!.second(2) {mock!.third(3) {4}}} subject.first(1).second(2).third(3).should == 4 -# mock(subject).first(1).mock!.second(2).mock!.third(3) {4} -# subject.first(1).second(2).third(3).should == 4 + pending("the implementation #mock, #stub, and #dont_allow on DoubleDefinition") do + mock(subject).first(1).mock!.second(2).mock!.third(3) {4} + subject.first(1).second(2).third(3).should == 4 + end end it 'allows branched chaining' do
Made terse chaining syntax spec pending.
rr_rr
train
rb
a3145d01e8cb098c1cf46c3f5c2293ab9387df94
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,7 +7,7 @@ require 'bourne' require File.expand_path('../../lib/mail_room', __FILE__) RSpec.configure do |config| - config.mock_with 'mocha/api' + config.mock_with :mocha config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true config.filter_run :focus
switch back to just :mocha
tpitale_mail_room
train
rb
ebf326bd2e0dd758943b0fb4494092b477fcffc4
diff --git a/premailer/premailer.py b/premailer/premailer.py index <HASH>..<HASH> 100644 --- a/premailer/premailer.py +++ b/premailer/premailer.py @@ -169,7 +169,7 @@ class Premailer(object): return rules, leftover - def transform(self, pretty_print=True): + def transform(self, pretty_print=True, **kwargs): """change the self.html and return it with CSS turned into style attributes. """ @@ -314,7 +314,9 @@ class Premailer(object): parent.attrib[attr] = urlparse.urljoin(self.base_url, parent.attrib[attr].lstrip('/')) - out = etree.tostring(root, method=self.method, pretty_print=pretty_print) + kwargs.setdefault('method', self.method) + kwargs.setdefault('pretty_print', pretty_print) + out = etree.tostring(root, **kwargs) if self.method == 'xml': out = _cdata_regex.sub(lambda m: '/*<![CDATA[*/%s/*]]>*/' % m.group(1), out) if self.strip_important:
add ability pass any arguments to etree.tostring with transform for example if I want set specific encoding instead default
peterbe_premailer
train
py
637aee4424e26ffce2bb1398e2a587b0ce1d6d94
diff --git a/lib/producer/topic_publish_info.js b/lib/producer/topic_publish_info.js index <HASH>..<HASH> 100644 --- a/lib/producer/topic_publish_info.js +++ b/lib/producer/topic_publish_info.js @@ -5,7 +5,7 @@ class TopicPublishInfo { this.orderTopic = false; this.haveTopicRouterInfo = false; this.messageQueueList = []; - this.sendWhichQueue = 0; + this.sendWhichQueue = Math.floor(Math.random() * Math.floor(Math.pow(2, 31))); // 打散 queue 选择起点 } /** @@ -36,6 +36,9 @@ class TopicPublishInfo { return null; } index = this.sendWhichQueue++; + if (!Number.isSafeInteger(this.sendWhichQueue)) { + this.sendWhichQueue = 0; // 超出安全范围,重置为 0 + } pos = Math.abs(index) % this.messageQueueList.length; return this.messageQueueList[pos]; }
fix: random-publish-queue-select-start-point (#<I>) * fix: random-publish-queue-select-start-point * fix: sendWhichQueue may exceed MAX_SAEF_INTEGER
ali-sdk_ali-ons
train
js
d68639663c11f5f57c59c44bf1d814af52fd4d63
diff --git a/pub/js/recently_viewed_products.js b/pub/js/recently_viewed_products.js index <HASH>..<HASH> 100644 --- a/pub/js/recently_viewed_products.js +++ b/pub/js/recently_viewed_products.js @@ -33,15 +33,17 @@ define(['lib/local_storage'], function(storage) { var products = storage.get(storageKey) || []; - var liHtml = products.reduce(function (carry, product) { + var liHtml = products.reduce(function (carry, product, index) { if (currentProduct.hasOwnProperty('sku') && product['sku'] !== currentProduct['sku']) { - carry += product['html']; + var elementHtml = product['html']; + if (index === products.length - 1) { + elementHtml = elementHtml.replace(/class="item"/igm, 'class="item last"'); + } + carry += elementHtml; } return carry; }, ''); - // TODO: Add "last" class to last element of the list. - return '<ul class="products-grid">' + liHtml + '</ul>'; } }
Issue #<I>: Add "last" class to last element of the list
lizards-and-pumpkins_catalog
train
js
3b8b4764adfeb860a3b126adb2f7702065d2fee6
diff --git a/odl/tomo/operators/ray_trafo.py b/odl/tomo/operators/ray_trafo.py index <HASH>..<HASH> 100644 --- a/odl/tomo/operators/ray_trafo.py +++ b/odl/tomo/operators/ray_trafo.py @@ -21,7 +21,7 @@ from __future__ import print_function, division, absolute_import from future import standard_library standard_library.install_aliases() -from future.builtins import str, super +from builtins import str, super # External import numpy as np
BUG: fix bad import from future
odlgroup_odl
train
py
a5a0b9350789b43def38bb8f4d3a96fee1a21fee
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -23,15 +23,15 @@ var _ = { } var event = new CustomEvent(type, props); - delete props.bubbles; - delete props.cancelable; - delete props.detail; for (var prop in props) { - event[_.prop(prop)] = props[prop]; + if (_.skip.indexOf(prop) < 0) { + event[_.prop(prop)] = props[prop]; + } } event.stopImmediatePropagation = _.sIP;//TODO: consider prototype extension return event; }, + skip: 'bubbles cancelable detail type'.split(' '), prop: function(prop){ return prop; },// only an extension hook sIP: function() { this.immediatePropagationStopped = true;
better non-writeable prop skipping
esha_Eventi
train
js
15c9486988aab140c9dde360dad2b9f763874e31
diff --git a/skyfield/timelib.py b/skyfield/timelib.py index <HASH>..<HASH> 100644 --- a/skyfield/timelib.py +++ b/skyfield/timelib.py @@ -223,7 +223,6 @@ class JulianDate(object): bc = year < 1 year = abs(year - bc) era = where(bc, 'B.C.', 'A.D.') - # TODO: does the JPL really zero-fill years < 4 digits? format = '%s %04d-%s-%02d %02d:%02d:%02d.%04d UT' args = (era, year, _months[month], day, hour, minute, second, fraction)
Remove a comment, having answered its question The answer was "yes".
skyfielders_python-skyfield
train
py
085615fad116591136e1196aa3ab16f72a3cad7f
diff --git a/nylas/client/restful_models.py b/nylas/client/restful_models.py index <HASH>..<HASH> 100644 --- a/nylas/client/restful_models.py +++ b/nylas/client/restful_models.py @@ -399,7 +399,7 @@ class Event(NylasAPIObject): attrs = ["id", "account_id", "title", "description", "location", "read_only", "when", "busy", "participants", "calendar_id", "recurrence", "status", "master_event_id", "owner", - "original_start_time", "object"] + "original_start_time", "object", "message_id"] collection_name = 'events' def __init__(self, api):
Add message_id to Event NylasAPIObject The `message_id` field seems to be missing from the documentation, but it seems that it is present when the event was created via email and it is not present with the event is a true calendar event. With this parameter, users can filter out "Invite"/"Accepted" events that all reference the same actual calendar event.
nylas_nylas-python
train
py
b8a8c189841fc7c946961de846022629b9198cfa
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -67,11 +67,11 @@ var _data = opts.data; var _methods = opts.methods; var _hooks = opts.hooks || {created: function() {}, mounted: function() {}, updated: function() {}, destroyed: function() {}}; + var _destroyed = false; var self = this; this.$el = document.querySelector(_el); this.$components = merge(opts.components || {}, components); this.$dom = {type: this.$el.nodeName, children: [], node: this.$el}; - this.$destroyed = false; // Change state when $data is changed Object.defineProperty(this, '$data', {
don't let it be accessable
kbrsh_moon
train
js
35cc110585c1687ab8d7788bed039f0bcd57b93a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -71,8 +71,6 @@ function Form(options) { self.emitQueue = []; - if (options.boundary) setUpParser(self, options.boundary); - self.on('newListener', function(eventName) { if (eventName === 'file') { self.autoFiles = true;
delete undocumented untested wtf thing
pillarjs_multiparty
train
js
7b5c240b1de8d2c26dc5493c77a74287fab461b0
diff --git a/tools/dbmaint.py b/tools/dbmaint.py index <HASH>..<HASH> 100755 --- a/tools/dbmaint.py +++ b/tools/dbmaint.py @@ -125,7 +125,7 @@ def version_key(string): """Returns a version representation useful for version comparison""" # remove the trailing '-<release>' number if any - string, _ = (string + '-').split('-', 1) + string = string.split('-', 1)[0] return version.StrictVersion(string)
Simplify stupid code (thanks to al-maisan). Former-commit-id: 3b<I>da<I>cce4e<I>a3e<I>a<I>dfcd8cadb1dba
gem_oq-engine
train
py
1d3490b92d1416a1a575a189fefe7b3b088236b1
diff --git a/tests/unittest_brain_numpy_core_multiarray.py b/tests/unittest_brain_numpy_core_multiarray.py index <HASH>..<HASH> 100644 --- a/tests/unittest_brain_numpy_core_multiarray.py +++ b/tests/unittest_brain_numpy_core_multiarray.py @@ -36,7 +36,7 @@ class BrainNumpyCoreMultiarrayTest(unittest.TestCase): ("is_busday", "['2011-07-01', '2011-07-02', '2011-07-18']"), ("lexsort", "(('toto', 'tutu'), ('riri', 'fifi'))"), ("packbits", "np.array([1, 2])"), - ("ravel_multi_index", "np.array([[1, 2], [2, 1]])", "(3, 4)"), + # ("ravel_multi_index", "np.array([[1, 2], [2, 1]])", "(3, 4)"), ("unpackbits", "np.array([[1], [2], [3]], dtype=np.uint8)"), ("vdot", "[1, 2]", "[1, 2]"), ("where", "[True, False]", "[1, 2]", "[2, 1]"),
DIsables the test for ravel_multi_index because strangely it fails when numpy is imported without alias whereas it is ok when numpy is imported with an alias. It should be investigated but is probably beyond the scope of this work.
PyCQA_astroid
train
py
360dbbc32d72ab5270d9511a1e1f182af91025f7
diff --git a/src/main/java/com/spencerwi/hamcrestJDK8Time/matchers/IsWithin.java b/src/main/java/com/spencerwi/hamcrestJDK8Time/matchers/IsWithin.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/spencerwi/hamcrestJDK8Time/matchers/IsWithin.java +++ b/src/main/java/com/spencerwi/hamcrestJDK8Time/matchers/IsWithin.java @@ -22,9 +22,9 @@ public class IsWithin<T extends Temporal & Comparable<? super T>> extends TypeSa T startOfWindow = (T) other.minus(window, units); T endOfWindow = (T) other.plus(window, units); return ( - (startOfWindow.compareTo(other) <= 0) + (startOfWindow.compareTo(item) <= 0) && - (endOfWindow.compareTo(other) >= 0) + (endOfWindow.compareTo(item) >= 0) ); }
Update IsWithin.java Nasty bug made the matcher always return true.
spencerwi_hamcrest-jdk8-time
train
java
e0e16c371f60d43af8a2adcb685967aa569ae3f1
diff --git a/integration/genfiles.go b/integration/genfiles.go index <HASH>..<HASH> 100644 --- a/integration/genfiles.go +++ b/integration/genfiles.go @@ -1,3 +1,5 @@ +// +build ignore + package main import ( diff --git a/integration/json.go b/integration/json.go index <HASH>..<HASH> 100644 --- a/integration/json.go +++ b/integration/json.go @@ -1,3 +1,5 @@ +// +build ignore + package main import ( diff --git a/integration/md5r.go b/integration/md5r.go index <HASH>..<HASH> 100644 --- a/integration/md5r.go +++ b/integration/md5r.go @@ -1,3 +1,5 @@ +// +build ignore + package main import (
Don't include test utils in testing
syncthing_syncthing
train
go,go,go
f2c3c608c0c60cf33115989fdfe1bc4b83a4b798
diff --git a/lib/unparser/cli/source.rb b/lib/unparser/cli/source.rb index <HASH>..<HASH> 100644 --- a/lib/unparser/cli/source.rb +++ b/lib/unparser/cli/source.rb @@ -30,10 +30,8 @@ module Unparser generated_ast.inspect.lines.map(&:chomp) ) report << 'Original:' - report << original_ast.inspect report << original_source report << 'Generated:' - report << generated_ast.inspect report << generated_source report.join("\n") end
Remove full AST output from CLI error reporting
mbj_unparser
train
rb
065a8e6f72dac45c2e78992708a2c57e1c6d0e08
diff --git a/zengine/auth/auth_backend.py b/zengine/auth/auth_backend.py index <HASH>..<HASH> 100644 --- a/zengine/auth/auth_backend.py +++ b/zengine/auth/auth_backend.py @@ -6,6 +6,7 @@ # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. +from pyoko.exceptions import ObjectDoesNotExist from zengine.models import * @@ -34,8 +35,11 @@ class AuthBackend(object): return user.superuser or perm in user.get_permissions() def authenticate(self, username, password): - user = User.objects.filter(username=username).get() - is_login_ok = user.check_password(password) - if is_login_ok: - self.session['user_id'] = user.key - return is_login_ok + try: + user = User.objects.filter(username=username).get() + is_login_ok = user.check_password(password) + if is_login_ok: + self.session['user_id'] = user.key + return is_login_ok + except ObjectDoesNotExist: + pass
fixed authbackend to properly handle the wrong / non-existent user case.
zetaops_zengine
train
py
a635034d9d2bbc963ba88418410fcb6b7c29e8db
diff --git a/src/vis/vis.js b/src/vis/vis.js index <HASH>..<HASH> 100644 --- a/src/vis/vis.js +++ b/src/vis/vis.js @@ -609,6 +609,7 @@ var Vis = cdb.core.View.extend({ if (vizjson.layers.length > 1) { for(var i = 1; i < vizjson.layers.length; ++i) { vizjson.layers[i].options.no_cdn = opt.no_cdn; + vizjson.layers[i].options.force_cors = opt.force_cors; } }
support force_cors in createVis
CartoDB_carto.js
train
js
901cab41ed71985cd5d239d5d815570100f2d2bf
diff --git a/src/Bkwld/Decoy/Routing/Wildcard.php b/src/Bkwld/Decoy/Routing/Wildcard.php index <HASH>..<HASH> 100644 --- a/src/Bkwld/Decoy/Routing/Wildcard.php +++ b/src/Bkwld/Decoy/Routing/Wildcard.php @@ -58,7 +58,7 @@ class Wildcard { // Invoke the controller $controller = new $controller(); $params = $id ? array($id) : array(); - return $controller->callAction(App::getFacadeApplication(), App::make('router'), $action, $params); + return $controller->callAction($action, $params); }
Fixing the way L<I> calls actions
BKWLD_decoy
train
php
e076fbbc06218609c567c03dff71202de1940bfb
diff --git a/lib/rack/jekyll.rb b/lib/rack/jekyll.rb index <HASH>..<HASH> 100644 --- a/lib/rack/jekyll.rb +++ b/lib/rack/jekyll.rb @@ -63,6 +63,9 @@ module Rack @request = Rack::Request.new(env) @response = Rack::Response.new path_info = @request.path_info + while @compiling + sleep 0.1 + end @files = ::Dir[@path + "/**/*"].inspect if @files == "[]" if @files.include?(path_info) if path_info =~ /(\/?)$/ @@ -88,9 +91,6 @@ module Rack else status, body, path_info = ::File.exist?(@path+"/404.html") ? [404,file_info(@path+"/404.html")[:body],"404.html"] : [404,"Not found","404.html"] mime = mime(path_info) - while @compiling - sleep 0.1 - end [status, {"Content-Type" => mime, "Content-length" => body.bytesize.to_s}, [body]] end
Wait before returning request if compiling, not just <I>s
adaoraul_rack-jekyll
train
rb
6d20f17c385925c6a180ba56a86f184556c0b02f
diff --git a/p2p/muxer/muxer-multistream/multistream.go b/p2p/muxer/muxer-multistream/multistream.go index <HASH>..<HASH> 100644 --- a/p2p/muxer/muxer-multistream/multistream.go +++ b/p2p/muxer/muxer-multistream/multistream.go @@ -7,7 +7,7 @@ import ( "net" "time" - smux "github.com/jbenet/go-stream-muxer" + smux "github.com/libp2p/go-stream-muxer" mss "github.com/multiformats/go-multistream" )
import the correct go-stream-muxer repo
libp2p_go-libp2p
train
go
5157c6f425e8c996d2519b1dc3b593050dac2751
diff --git a/lib/app/app.js b/lib/app/app.js index <HASH>..<HASH> 100644 --- a/lib/app/app.js +++ b/lib/app/app.js @@ -76,9 +76,9 @@ export function createApp () { }) const options = {} - - themeEnhanceApp({ Vue, options, router }) - enhanceApp({ Vue, options, router }) + + themeEnhanceApp({ Vue, options, router, siteData }) + enhanceApp({ Vue, options, router, siteData }) const app = new Vue( Object.assign(options, {
feat: also expose siteData in enhanceApp.js
vuejs_vuepress
train
js
ac16ffe3e3d67cf2d5d2f0f87009a72550ea4127
diff --git a/chef/lib/chef/provider/file.rb b/chef/lib/chef/provider/file.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/file.rb +++ b/chef/lib/chef/provider/file.rb @@ -58,6 +58,7 @@ class Chef def is_binary?(path) ::File.open(path) do |file| + buff = file.read(Chef::Config[:diff_filesize_threshold]) buff = "" if buff.nil? return buff !~ /^[\r[:print:]]*$/
fix diff output, add tweakables, refactor diff code
chef_chef
train
rb
440285601d402e6f8137c0f0a4afa76f7c55637c
diff --git a/shared/chat/inbox/container/filtered.js b/shared/chat/inbox/container/filtered.js index <HASH>..<HASH> 100644 --- a/shared/chat/inbox/container/filtered.js +++ b/shared/chat/inbox/container/filtered.js @@ -53,7 +53,10 @@ const score = (lcFilter: string, lcYou: string, names: Array<string>, insertMatc // insertionDistance = searchStr.length - filter.length // 1 / (insertionDistance + 1) * 20 // 20 <= insertionScore < 0 - const insertionScore = insertionMatch ? (1 / (searchStr.length - filter.length + 1)) * 20 : 0 + let insertionScore = 0 + if (filter) { + insertionScore = insertionMatch ? (1 / (searchStr.length - filter.length + 1)) * 20 : 0 + } let rawScore = (foundExact ? 1000 : 0) + (foundPrefix ? 100 : 0) + insertionScore + (foundSub ? 10 : 0)
check filter in filtered container (#<I>)
keybase_client
train
js
6f6030073000b22458a8e0bf2fa8b15b4ac3c9af
diff --git a/lib/FieldType/XmlText/Value.php b/lib/FieldType/XmlText/Value.php index <HASH>..<HASH> 100644 --- a/lib/FieldType/XmlText/Value.php +++ b/lib/FieldType/XmlText/Value.php @@ -51,14 +51,6 @@ class Value extends BaseValue } /** - * @see \eZ\Publish\Core\FieldType\Value::getTitle() - */ - public function getTitle() - { - throw new \RuntimeException( 'Implement this method' ); - } - - /** * Returns the input handler depending on the input value type * * @return \eZ\Publish\Core\FieldType\XmlText\Input\Handler
Removed: depracated Value::getTitle() method, FieldType::getName() is to be used instead
ezsystems_ezplatform-xmltext-fieldtype
train
php
6a65979ccd0b2b741fd07ec5c6d0efa035533997
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -170,7 +170,7 @@ app.use('/config', mustBeAdmin); update → PUT /collection/id delete → DELETE /collection/id ============================================================================= */ -require('./routes/oauth.js')(router, passport, router); +require('./routes/oauth.js')(app, passport, router); require('./routes/homepage.js')(app, router); require('./routes/onboarding.js')(app, router); require('./routes/user-admin.js')(app, router);
Fixing oauth routes call
rickbergfalk_sqlpad
train
js
7c0d57e386b1352b6e285b85017ad9cbff0bcc82
diff --git a/src/org/jcodings/EncodingDB.java b/src/org/jcodings/EncodingDB.java index <HASH>..<HASH> 100644 --- a/src/org/jcodings/EncodingDB.java +++ b/src/org/jcodings/EncodingDB.java @@ -171,13 +171,20 @@ public class EncodingDB { } public static void replicate(String replica, String original) { - replicate(replica, original, false); + byte[]origBytes = original.getBytes(); + Entry originalEntry = encodings.get(origBytes); + if (originalEntry == null) throw new InternalException(ErrorMessages.ERR_NO_SUCH_ENCODNG, original); + finishReplica(replica, originalEntry.isDummy, originalEntry); } private static void replicate(String replica, String original, boolean dummy) { byte[]origBytes = original.getBytes(); Entry originalEntry = encodings.get(origBytes); if (originalEntry == null) throw new InternalException(ErrorMessages.ERR_NO_SUCH_ENCODNG, original); + finishReplica(replica, dummy, originalEntry); + } + + private static void finishReplica(String replica, boolean dummy, Entry originalEntry) { byte[]replicaBytes = replica.getBytes(); if (encodings.get(replicaBytes) != null) throw new InternalException(ErrorMessages.ERR_ENCODING_REPLICA_ALREADY_REGISTERED, replica); encodings.putDirect(replicaBytes, new Entry(replicaBytes, originalEntry, dummy));
Replicas of dummy encodings should also be dummy encodings.
jruby_jcodings
train
java
bfc03b1b18c4e579e997766d007ecd45a256ad72
diff --git a/src/js/utils/DOM.js b/src/js/utils/DOM.js index <HASH>..<HASH> 100644 --- a/src/js/utils/DOM.js +++ b/src/js/utils/DOM.js @@ -32,7 +32,11 @@ export function findScrollParents (element, horizontal) { } parent = parent.parentNode; } - result.push(document); + // last scrollable element will be the document + // if nothing else is scrollable in the page + if (result.length === 0) { + result.push(document); + } return result; }
Fixed infinite scroll issue with the multiple scroll parents
grommet_grommet
train
js
4d9e157c1ddc72d1f2fce7947b2f1dcec04e9dc9
diff --git a/generator/test/classes/propel/FieldnameRelatedTest.php b/generator/test/classes/propel/FieldnameRelatedTest.php index <HASH>..<HASH> 100644 --- a/generator/test/classes/propel/FieldnameRelatedTest.php +++ b/generator/test/classes/propel/FieldnameRelatedTest.php @@ -97,8 +97,8 @@ class FieldnameRelatedTest extends PHPUnit2_Framework_TestCase { $this->assertEquals( $expecteds[$type], $results[$type], - 'expected was: ' . print_r($expected, 1) . - 'but getFieldnames() returned ' . print_r($result, 1) + 'expected was: ' . print_r($expecteds[$type], 1) . + 'but getFieldnames() returned ' . print_r($results[$type], 1) ); } } @@ -177,8 +177,8 @@ class FieldnameRelatedTest extends PHPUnit2_Framework_TestCase { $this->assertEquals( $expecteds[$type], $results[$type], - 'expected was: ' . print_r($expected, 1) . - 'but getFieldnames() returned ' . print_r($result, 1) + 'expected was: ' . print_r($expecteds[$type], 1) . + 'but getFieldnames() returned ' . print_r($results[$type], 1) ); } }
Fixed some E_NOTICE related to undefined vars.
propelorm_Propel
train
php
d0cc877cc5506f86acca4e44fd916ee499431388
diff --git a/rules/cloudTrail.js b/rules/cloudTrail.js index <HASH>..<HASH> 100644 --- a/rules/cloudTrail.js +++ b/rules/cloudTrail.js @@ -17,7 +17,14 @@ module.exports.config = { "detail": { "eventSource": [ "cloudtrail.amazonaws.com" - ] + ], + "eventName": [ + "CreateTrail", + "DeleteTrail", + "StartLogging", + "StopLogging", + "UpdateTrail" + ] } } }
Specifies CloudTrail CloudWatch events Changes CloudTrail CloudWatch event JSON from all events to a specified array of events.
mapbox_patrol-rules-aws
train
js
0f99afd49a870e2ba6cfcad798b1d9f536042f09
diff --git a/lib/discordrb/cache.rb b/lib/discordrb/cache.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/cache.rb +++ b/lib/discordrb/cache.rb @@ -176,13 +176,15 @@ module Discordrb # Finds a channel given its name and optionally the name of the server it is in. # @param channel_name [String] The channel to search for. # @param server_name [String] The server to search for, or `nil` if only the channel should be searched for. + # @param type [String, nil] The type of channel to search for (`'text'` or `'voice'`), or `nil` if either type of + # channel should be searched for # @return [Array<Channel>] The array of channels that were found. May be empty if none were found. - def find_channel(channel_name, server_name = nil) + def find_channel(channel_name, server_name = nil, type: nil) results = [] @servers.values.each do |server| server.channels.each do |channel| - results << channel if channel.name == channel_name && (server_name || server.name) == server.name + results << channel if channel.name == channel_name && (server_name || server.name) == server.name && (!type || (channel.type == type)) end end
Add a type parameter to find_channel to allow searching for channels of a specific type
meew0_discordrb
train
rb
71924f4b9e0da01af0d6b063e2165284cf943931
diff --git a/src/js/plugins/forward.js b/src/js/plugins/forward.js index <HASH>..<HASH> 100644 --- a/src/js/plugins/forward.js +++ b/src/js/plugins/forward.js @@ -73,7 +73,7 @@ class Forward extends BaseComponent { */ const toggles = SelectorEngine.find(SELECTOR_TOGGLE) toggles.forEach((toggle) => { - EventHandler.on(toggle, EVENT_CLICK_DATA_API, (evt) => { + EventHandler.one(toggle, EVENT_CLICK_DATA_API, (evt) => { evt.preventDefault() const forward = Forward.getOrCreateInstance(toggle) forward.goToTarget()
chore(core): changes for forward activation
italia_bootstrap-italia
train
js
e16dd8dc081a57d51bc22df74b9be3f858e7535f
diff --git a/lib/representors/representor.rb b/lib/representors/representor.rb index <HASH>..<HASH> 100644 --- a/lib/representors/representor.rb +++ b/lib/representors/representor.rb @@ -128,8 +128,8 @@ module Representors v.flatten.map do |item| trans_hash = item[:transitions].find { |t| t[:rel] == "self" } if trans_hash - prop_hash = item[:transitions].find { |t| t[:rel] == "profile" } - trans_hash.merge(prop_hash) if prop_hash + profile_href = item[:links][:profile] if item[:links] + trans_hash = trans_hash.merge(profile: profile_href) if profile_href trans_hash.merge(rel: k) else {}
refactor profile to work this time
mdsol_representors
train
rb
3784068475c0109bfec0a9eb5877c4ae2e8b5a72
diff --git a/railties/lib/rails/all.rb b/railties/lib/rails/all.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/all.rb +++ b/railties/lib/rails/all.rb @@ -6,7 +6,7 @@ require "rails" action_view/railtie action_mailer/railtie active_job/railtie - action_cable/engine + action_cable/railtie rails/test_unit/railtie sprockets/railtie ).each do |railtie|
Another bad reference to engine instead of railtie
rails_rails
train
rb
20f3f27736bd5f5c78b9d434dd92daf474d6ce14
diff --git a/lib/store/embeddedProvider.js b/lib/store/embeddedProvider.js index <HASH>..<HASH> 100644 --- a/lib/store/embeddedProvider.js +++ b/lib/store/embeddedProvider.js @@ -88,7 +88,7 @@ EmbeddedCollection.prototype._convertBinaryToBuffer = function (res) { if (propDef.type === "Edm.Binary") { //nedb returns object instead of buffer on node 4 - if (res[i][prop].type !== 'Buffer') { + if (res[i][prop].type !== 'Buffer' && !res[i][prop].length) { var obj = res[i][prop]; res[i][prop] = Object.keys(obj).map(function (key) {return obj[key]; }); }
fix failing tests on the node <I> - better handling of nedb difference on different node versions
jsreport_jsreport-embedded-store
train
js
90c12a9c7b9c8ca335a28318057d7b415c3c02f4
diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py index <HASH>..<HASH> 100644 --- a/salt/states/saltmod.py +++ b/salt/states/saltmod.py @@ -584,6 +584,7 @@ def runner(name, **kwargs): ret['result'] = True ret['comment'] = "Runner function '{0}' executed.".format(name) + ret['__orchestration__'] = True if out: ret['changes'] = out @@ -616,6 +617,7 @@ def wheel(name, **kwargs): ret['result'] = True ret['comment'] = "Wheel function '{0}' executed.".format(name) + ret['__orchestration__'] = True if out: ret['changes'] = out
Add __orchestration__ key to orch returns for runner/wheel funcs This gets passed through to the highstate outputter to suppress the error in the output when the changes param is not a dict.
saltstack_salt
train
py
4fe7aef123d639f1fa0e15e71bdc31952afb60de
diff --git a/lib/Hotels/HotelsErrors.js b/lib/Hotels/HotelsErrors.js index <HASH>..<HASH> 100644 --- a/lib/Hotels/HotelsErrors.js +++ b/lib/Hotels/HotelsErrors.js @@ -12,7 +12,7 @@ module.exports = function(err) { throw new uError('EMPTY_RESULTS', err); break; case 5000: - throw new uError('NO_CITY_RESULTS', err); + throw new uError('GENERAL_ERROR', err); break; case 5574: throw new uError('NO_ENGINES_RESULTS', err); diff --git a/lib/errors.js b/lib/errors.js index <HASH>..<HASH> 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -13,7 +13,7 @@ var allErrors = { EMPTY_RESULTS: {errno: 13, msg: "No results for current request."}, NO_ENGINES_RESULTS: {errno: 14, msg:"None of the enabled engines could fulfill your request."}, NO_CITY_RESULTS: {errno: 15, msg: "Cant find hotels for curreny city."}, - + GENERAL_ERROR: {errno: 16, msg: 'General hotel service error'}, // HOTELS VALIDATION ERRORS VALIDATION_LOCATION : {errno: 101, msg: "Missing location in request."},
Fix: changed error with code <I> - General hotel service error.
Travelport-Ukraine_uapi-json
train
js,js
4894db2484464f2a78bf1ac9301689ff947ae3df
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,14 +22,16 @@ gulp.task('build-bower', ['clean'], function(){ }); gulp.task('build-npm', ['clean'], function(){ - return gulp.src(['src/core/serilog.js', 'src/npm/*.js']) + return gulp.src(['src/core/serilog.js', 'src/npm/*.js', 'src/npm/*.json']) .pipe(jshint('.jshintrc')) .pipe(jshint.reporter('default')) .pipe(jshint.reporter('fail')) .pipe(gulp.dest('dist/npm')); }); -gulp.task('test', ['build-bower', 'build-npm'], function(cb) { +gulp.task('build', ['build-bower', 'build-npm']); + +gulp.task('test', ['build'], function(cb) { childProcess.exec('mocha --reporter=spec', function(error, stdout, stderr){ console.log(stdout); console.log(stderr);
Now copying the npm package file to the dist folder where the npm package is generated. Created a 'build' task that invokes both npm and bower builds.
structured-log_structured-log
train
js
d61a9bbdc17716ff9e40a7bd7eaa56f6737a4dc2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -45,9 +45,9 @@ setup(name='jottalib', package_dir={'':'src'}, packages=['jottalib', ], scripts=['src/jottafuse.py', 'src/jottashare.py'], - install_requires=['requests==2.1.0', + install_requires=['requests', 'requests_toolbelt', - 'requests_cache==0.4.4', + 'requests_cache', 'python-dateutil', 'lxml'], )
Stop pinning requests and requests_cache, it is dangerous
havardgulldahl_jottalib
train
py
4e92005de9dd684bacbd5533a2f72e3de15060e6
diff --git a/restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderClassCreator.java b/restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderClassCreator.java index <HASH>..<HASH> 100644 --- a/restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderClassCreator.java +++ b/restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderClassCreator.java @@ -94,7 +94,8 @@ public class JsonEncoderDecoderClassCreator extends BaseSourceCreator { public JsonEncoderDecoderClassCreator(TreeLogger logger, GeneratorContext context, JClassType source) { super(logger, context, source, JSON_ENCODER_SUFFIX); - javaBeansNamingConventionEnabled = false; + // true, if the naming convention from JavaBeans API specification should be used + javaBeansNamingConventionEnabled = getBooleanProperty(getLogger(), context.getPropertyOracle(), USE_JAVA_BEANS_SPEC_NAMING_CONVENTION_CONFIGURATION_PROPERTY_NAME, true); } @Override
Get value of property to decide JavaBeans naming convention should be used
resty-gwt_resty-gwt
train
java
dc7be950b1259458af0f1a5bff076bacf3594d23
diff --git a/packages/@vuepress/core/lib/app/components/Content.js b/packages/@vuepress/core/lib/app/components/Content.js index <HASH>..<HASH> 100644 --- a/packages/@vuepress/core/lib/app/components/Content.js +++ b/packages/@vuepress/core/lib/app/components/Content.js @@ -13,7 +13,7 @@ export default { if (Vue.$vuepress.isPageExists(pageKey)) { // In SSR, if a component is not registered with the component option // vue-server-renderer will not be able to resovle it. - if (!parent.$ssrContext) { + if (!this.$parent.$ssrContext) { Vue.$vuepress.registerPageAsyncComponent(pageKey) }
fix($core): variable `parent` is undefined in build process (#<I>)
vuejs_vuepress
train
js
35995276ab5d70e7f1051ad46ffa4ae1f7a5aeff
diff --git a/spec/integration/resource_spec.rb b/spec/integration/resource_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/resource_spec.rb +++ b/spec/integration/resource_spec.rb @@ -9,12 +9,32 @@ if ADAPTER property :color, String end + class FortunePig + include DataMapper::Resource + + property :id, Integer, :serial => true + property :name, String + + def to_s + name + end + end + Orange.auto_migrate!(ADAPTER) + FortunePig.auto_migrate!(ADAPTER) + orange = Orange.new(:color => 'orange') orange.name = 'Bob' # Keys are protected from mass-assignment by default. repository(ADAPTER) { orange.save } end + it "should be able to overwrite Resource#to_s" do + repository(ADAPTER) do + ted = FortunePig.create!(:name => "Ted") + FortunePig[ted.id].to_s.should == 'Ted' + end + end + it "should be able to reload objects" do orange = repository(ADAPTER) { Orange['Bob'] } orange.color.should == 'orange'
Integration spec for Resource#to_s overwrite.
datamapper_dm-core
train
rb
8320c8fe2f8ad2f3ba1fabae5ee0ec30bbdfa9d8
diff --git a/test/Shrinker/MultipleTest.php b/test/Shrinker/MultipleTest.php index <HASH>..<HASH> 100644 --- a/test/Shrinker/MultipleTest.php +++ b/test/Shrinker/MultipleTest.php @@ -7,7 +7,7 @@ use Eris\Generator\GeneratedValueOptions; use RuntimeException; use PHPUnit\Framework\AssertionFailedError; use PHPUnit_Framework_AssertionFailedError; -use Throwable; +use Exception; class MultipleTest extends \PHPUnit_Framework_TestCase { @@ -61,7 +61,7 @@ class MultipleTest extends \PHPUnit_Framework_TestCase } } - private function verifyAssertionFailure(Throwable $e, $startingPoint) + private function verifyAssertionFailure(Exception $e, $startingPoint) { $this->assertEquals("Failed asserting that 5001 is equal to 5000 or is less than 5000.", $e->getMessage()); $allValues = array_map(function ($generatedValue) {
Use Exception rather than Throwable for PHP 5.x compatibility
giorgiosironi_eris
train
php
6f526f74519b9fe97dfa2ebb2870f31b6cac93a2
diff --git a/lang/en/moodle.php b/lang/en/moodle.php index <HASH>..<HASH> 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -411,6 +411,7 @@ $string['language'] = "Language"; $string['languagegood'] = "This language pack is up-to-date! :-)"; $string['lastaccess'] = "Last access"; $string['lastedited'] = "Last edited"; +$string['lastlogin'] = "Last Login"; $string['lastmodified'] = "Last modified"; $string['lastname'] = "Last name"; $string['latestlanguagepack'] = "Check for latest language pack on moodle.org"; @@ -714,6 +715,7 @@ $string['someerrorswerefound'] = "Some information was missing or incorrect. Loo $string['startdate'] = "Course start date"; $string['students'] = "Students"; $string['restorecoursenow'] = "Restore this course now!"; +$string['since'] = "Since"; $string['startsignup'] = "Start now by creating a new account!"; $string['state'] = "State/Province"; $string['status'] = "Status";
Added some words for course/recent.php
moodle_moodle
train
php
de608f9e32d1481892e7f846ace92fbc03c36f92
diff --git a/jodd-http/src/main/java/jodd/http/HttpResponse.java b/jodd-http/src/main/java/jodd/http/HttpResponse.java index <HASH>..<HASH> 100644 --- a/jodd-http/src/main/java/jodd/http/HttpResponse.java +++ b/jodd-http/src/main/java/jodd/http/HttpResponse.java @@ -171,6 +171,9 @@ public class HttpResponse extends HttpBase<HttpResponse> { httpResponse.httpVersion(line.substring(0, ndx)); int ndx2 = line.indexOf(' ', ndx + 1); + if (ndx2 == -1) { + ndx2 = line.length(); + } httpResponse.statusCode(Integer.parseInt(line.substring(ndx, ndx2).trim())); httpResponse.statusPhrase(line.substring(ndx2).trim());
Fixes exception when response status phrase is missing (fixes #<I>)
oblac_jodd
train
java
7536f6237e3a9f4b32d4d25b10ff2e2113fafcb9
diff --git a/flow/table.go b/flow/table.go index <HASH>..<HASH> 100644 --- a/flow/table.go +++ b/flow/table.go @@ -52,7 +52,6 @@ func (ft *FlowTable) AsyncExpire(fn ExpireFunc, every time.Duration) { expire := now.Unix() - int64((every).Seconds()) ft.lock.Lock() - defer ft.lock.Unlock() for key, f := range ft.table { fs := f.GetStatistics() if fs.Last < expire { @@ -63,6 +62,7 @@ func (ft *FlowTable) AsyncExpire(fn ExpireFunc, every time.Duration) { delete(ft.table, key) } } + ft.lock.Unlock() logging.GetLogger().Debug("%v Expire Flow : removed %v new size %v", now, flowTableSzBefore-len(ft.table), len(ft.table)) } }
[FlowTable] fixup race condition on AsyncExpire
skydive-project_skydive
train
go
50d573c2548069a411228987d0fd2c9dd9c48fdb
diff --git a/tests/numpy_utils.py b/tests/numpy_utils.py index <HASH>..<HASH> 100644 --- a/tests/numpy_utils.py +++ b/tests/numpy_utils.py @@ -24,8 +24,12 @@ def check_fun_and_grads(fun, args, kwargs, argnums): wrt_args = [args[i] for i in argnums] try: if isinstance(fun, primitive): - check_equivalent(fun(*args, **kwargs), - fun.fun(*args, **kwargs)) + wrapped = fun(*args, **kwargs) + unwrapped = fun.fun(*args, **kwargs) + try: + assert wrapped == unwrapped + except: + check_equivalent(wrapped, unwrapped) except: print("Value test failed! Args were", args, kwargs) raise
Value checks were failing because vspace can't handle ints. Fixed by testing for direct equality before resorting to vspace equivalence test
HIPS_autograd
train
py
69f694c52151c627ae1d35c9c2b30947fa2dc35c
diff --git a/pecan/rest.py b/pecan/rest.py index <HASH>..<HASH> 100644 --- a/pecan/rest.py +++ b/pecan/rest.py @@ -29,12 +29,6 @@ class RestController(object): handler = getattr(self, '_handle_%s' % method, self._handle_custom) result = handler(method, args) - # remove the "_method" workaround - if '_method' in request.POST: - del request.POST['_method'] - if '_method' in request.GET: - del request.GET['_method'] - # return the result return result
Leaving the _method workaround for htmlfill use
pecan_pecan
train
py
4d29510c8a08551886e60a59430149877f9bd0e1
diff --git a/scripts/homestead.rb b/scripts/homestead.rb index <HASH>..<HASH> 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -183,7 +183,7 @@ class Homestead end # For b/w compatibility keep separate 'mount_opts', but merge with options - options = (folder['options'] || {}).merge({ mount_options: mount_opts }) + options = (folder['options'] || {}).merge({ mount_options: mount_opts }).merge(smb_creds || {}) # Double-splat (**) operator only works with symbol keys, so convert options.keys.each{|k| options[k.to_sym] = options.delete(k) }
Merge SMB creds from Homestead.yaml into config (#<I>) While SMB credentials were being parsed, they weren't being merged into the effective configuration; this change implements the intended behavior.
laravel_homestead
train
rb
df65f0d4c325782f62fc4b48b30a22fcb0c04962
diff --git a/lib/tunnel.js b/lib/tunnel.js index <HASH>..<HASH> 100644 --- a/lib/tunnel.js +++ b/lib/tunnel.js @@ -77,7 +77,14 @@ function tunnelProxy(server, proxy) { return true; }; var isIntercept = function() { - return isLocalUIUrl || (!isDisabeIntercept() && isEnableIntercept()); + if (isLocalUIUrl || (!isDisabeIntercept() && isEnableIntercept())) { + return true; + } + if (!isIPHost || disable.captureIp || disable.captureIP) { + return false; + } + var enable = req.enable; + return (isWebPort && enable.captureIp) || enable.captureIP; }; var plugin = !isIntercept() && pluginMgr.resolveWhistlePlugins(req); var handlePluginRules = function(_rulesMgr) {
feat: add enable://captureIp to capture the connect which the hostname is ip
avwo_whistle
train
js
c0d0e0eff61e0ffbc1cce2668cbce297c0345356
diff --git a/bids/analysis/transformations/compute.py b/bids/analysis/transformations/compute.py index <HASH>..<HASH> 100644 --- a/bids/analysis/transformations/compute.py +++ b/bids/analysis/transformations/compute.py @@ -177,7 +177,7 @@ class and_(Transformation): return df.all(axis=1).astype(int) -class convolve_HRF(Transformation): +class convolve(Transformation): """Convolve the input variable with an HRF. Args: diff --git a/bids/analysis/transformations/munge.py b/bids/analysis/transformations/munge.py index <HASH>..<HASH> 100644 --- a/bids/analysis/transformations/munge.py +++ b/bids/analysis/transformations/munge.py @@ -262,11 +262,11 @@ class select(Transformation): self.collection.variables = {v.name: v for v in variables} -class remove(Transformation): - ''' Remove variables from the namespace. +class delete(Transformation): + ''' Delete variables from the namespace. Args: - variables (list, str): Name(s) of variables to remove. + variables (list, str): Name(s) of variables to delete. ''' _groupable = False _loopable = False
Rename existing transformations (convolve_hrf, delete) to spec names
bids-standard_pybids
train
py,py
87c5d96d303ab69be49faa9d9515e984b47cfc7c
diff --git a/api/app/handler.go b/api/app/handler.go index <HASH>..<HASH> 100644 --- a/api/app/handler.go +++ b/api/app/handler.go @@ -47,7 +47,7 @@ func CloneRepositoryHandler(w http.ResponseWriter, r *http.Request) error { return &errors.Http{Code: http.StatusInternalServerError, Message: string(output)} } } - fmt.Fprint(w, output) + fmt.Fprint(w, string(output)) return nil }
Converting bytes to string in clone handler output
tsuru_tsuru
train
go
0e795d850d8798b477be3a8f2a7e65030bf754aa
diff --git a/src/admin/migrations/m150108_154017_cms_block.php b/src/admin/migrations/m150108_154017_cms_block.php index <HASH>..<HASH> 100644 --- a/src/admin/migrations/m150108_154017_cms_block.php +++ b/src/admin/migrations/m150108_154017_cms_block.php @@ -16,6 +16,6 @@ class m150108_154017_cms_block extends Migration public function safeDown() { - $this->dropTable('createTable'); + $this->dropTable('cms_block'); } }
Correct drop table (#<I>)
luyadev_luya-module-cms
train
php
88e92389f6b3bc4162ace694925db7737fc62013
diff --git a/lib/standard_api/access_control_list.rb b/lib/standard_api/access_control_list.rb index <HASH>..<HASH> 100644 --- a/lib/standard_api/access_control_list.rb +++ b/lib/standard_api/access_control_list.rb @@ -67,7 +67,7 @@ module StandardAPI if self.respond_to?("nested_#{model_name(model)}_attributes", true) self.send("nested_#{model_name(model)}_attributes").each do |relation| relation = model.reflect_on_association(relation) - attributes_key = "#{relation.klass.base_class.model_name.singular}_attributes" + attributes_key = "#{relation.name}_attributes" filter_method = "filter_#{relation.klass.base_class.model_name.singular}_params" if model_params.has_key?(attributes_key)
Fix issue with ACL and nested collection relationships
waratuman_standardapi
train
rb
430973b85b75a99218554d862f494a01850ee734
diff --git a/core/server/helpers/date.js b/core/server/helpers/date.js index <HASH>..<HASH> 100644 --- a/core/server/helpers/date.js +++ b/core/server/helpers/date.js @@ -27,6 +27,7 @@ module.exports = function (date, options) { format = options.hash.format || 'MMM DD, YYYY'; timeago = options.hash.timeago; + timezone = options.data.blog.timezone; timeNow = moment().tz(timezone); if (timeago) {
🐛 Fixed date helper timezone bug closes #<I> Fixes a bug where the date helper would ignore any timezone settings, when called with a specific date option, e. g. `published_at`, as `timezone` was only ever assigned when called without options.
TryGhost_Ghost
train
js
6118590a6a4e09fa7fb65959b59ac849754d34cb
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -1855,9 +1855,21 @@ class State(object): running[tag]['__sls__'] = low['__sls__'] # otherwise the failure was due to a requisite down the chain else: + # determine what the requisite failures where, and return + # a nice error message + comment_dict = {} + for req_type, req_lows in reqs.iteritems(): + for req_low in req_lows: + req_tag = _gen_tag(req_low) + req_ret = self.pre.get(req_tag, running.get(req_tag)) + if req_ret is None: + continue + if req_ret['result'] is False: + comment_dict[req_low['__id__']] = req_ret['comment'] + running[tag] = {'changes': {}, 'result': False, - 'comment': 'One or more requisite failed', + 'comment': 'One or more requisite failed: {0}'.format(comment_dict), '__run_num__': self.__run_num, '__sls__': low['__sls__']} self.__run_num += 1
Fix for #<I> On a requisite failure, instead of saying "something failed" we can determine what the failures where by looking at the requisites of the lowstate running, and see which ones failed.
saltstack_salt
train
py
3f781f26b8a6ae88a59879cda5961d981eaa666c
diff --git a/test/unit/mongo/MongoTripodConfigTest.php b/test/unit/mongo/MongoTripodConfigTest.php index <HASH>..<HASH> 100644 --- a/test/unit/mongo/MongoTripodConfigTest.php +++ b/test/unit/mongo/MongoTripodConfigTest.php @@ -884,7 +884,7 @@ class MongoTripodConfigTest extends MongoTripodTestBase public function testGetAllTypesInSpecifications() { $types = $this->tripodConfig->getAllTypesInSpecifications(); - $this->assertEquals(7, count($types), "There should be 7 types based on the configured view, table and search specifications in config.json"); + $this->assertEquals(8, count($types), "There should be 7 types based on the configured view, table and search specifications in config.json"); $expectedValues = array( "acorn:Resource", "acorn:Work", @@ -892,7 +892,8 @@ class MongoTripodConfigTest extends MongoTripodTestBase "acorn:Work2", "bibo:Book", "resourcelist:List", - "spec:User" + "spec:User", + "bibo:Document" ); foreach($expectedValues as $expected){
Add bibo:Document to expected types
talis_tripod-php
train
php
c1bed82e7c0c2dd0e0b8151d1cf1646c26c0f3f6
diff --git a/opal/action_pack/action_syncer.rb b/opal/action_pack/action_syncer.rb index <HASH>..<HASH> 100644 --- a/opal/action_pack/action_syncer.rb +++ b/opal/action_pack/action_syncer.rb @@ -28,6 +28,11 @@ class ActionSyncer @state = state @retry_count = 0 end + + def reset + @retry_count = 0 + @state = :idle + end end class ObjectsFromUpdates @@ -106,6 +111,15 @@ class ActionSyncer process_queue end + def retry_on_change + object_to_update = @object_queue.first + if object_to_update + object_to_update.reset + + process_queue + end + end + # # do a HTTP GET operation from the supplied path every frequency milliseconds # @@ -133,6 +147,7 @@ class ActionSyncer puts "GET(#{updater.url})" HTTP.get(updater.url, headers: headers) do |response| if response.status_code.to_i == 200 + @application.update_every_succeeded puts "response.json = #{response.json}" response.json.each do |object_json| @application.create_or_update_object_from_object_key_and_attributes(object_json.keys.first, object_json.values.first)
add ability to allow application to restart updates
boberetezeke_opal-actionpack
train
rb
80abc096b0cfee2bfd6ce4390deceadbc6bb4728
diff --git a/glances/glances.py b/glances/glances.py index <HASH>..<HASH> 100755 --- a/glances/glances.py +++ b/glances/glances.py @@ -904,7 +904,10 @@ class GlancesStats: self.host = {} self.host['os_name'] = platform.system() self.host['hostname'] = platform.node() - self.host['platform'] = platform.architecture()[0] + if platform.uname()[4]: + self.host['platform'] = platform.uname()[4] + else: + self.host['platform'] = platform.architecture()[0] is_archlinux = os.path.exists(os.path.join("/", "etc", "arch-release")) if self.host['os_name'] == "Linux": if is_archlinux:
platform/architecture is more specific now (at least on unix)
nicolargo_glances
train
py
04f12a036cd9d81ce8eda582021cacf0b47b90f5
diff --git a/tests/csv/csv_logger_conf_test.py b/tests/csv/csv_logger_conf_test.py index <HASH>..<HASH> 100755 --- a/tests/csv/csv_logger_conf_test.py +++ b/tests/csv/csv_logger_conf_test.py @@ -16,7 +16,7 @@ from scs_host.sys.host import Host root_path = '/Volumes/SCS/data' -conf = CSVLoggerConf(root_path, True) +conf = CSVLoggerConf(root_path, True, 0) print(conf) print("-")
Added write_interval field to CSVLoggerConf class.
south-coast-science_scs_core
train
py
ad8cb84e510dd3c56dd57a7e6d6100274b5c4b3e
diff --git a/phy/utils/tests/test_context.py b/phy/utils/tests/test_context.py index <HASH>..<HASH> 100644 --- a/phy/utils/tests/test_context.py +++ b/phy/utils/tests/test_context.py @@ -10,8 +10,7 @@ import os import numpy as np from numpy.testing import assert_array_equal as ae -from pytest import fixture, yield_fixture, mark -from ipyparallel.tests.clienttest import ClusterTestCase, add_engines +from pytest import yield_fixture from ..context import Context, _iter_chunks_dask @@ -82,5 +81,9 @@ def ipy_client(): ipyparallel.tests.teardown() -def test_client(ipy_client): - print(ipy_client.ids) +def test_client_1(ipy_client): + assert ipy_client.ids == [0, 1] + + +def test_client_2(ipy_client): + assert ipy_client[:].map_sync(lambda x: x * x, [1, 2, 3]) == [1, 4, 9]
Done ipy_client fixtures
kwikteam_phy
train
py
14d65f4ae88b9c7d30291464e0f0638237aadc75
diff --git a/src/sagemaker/_studio.py b/src/sagemaker/_studio.py index <HASH>..<HASH> 100644 --- a/src/sagemaker/_studio.py +++ b/src/sagemaker/_studio.py @@ -46,6 +46,7 @@ def _append_project_tags(tags=None, working_dir=None): return tags all_tags = tags or [] + additional_tags = [tag for tag in additional_tags if tag not in all_tags] all_tags.extend(additional_tags) return all_tags diff --git a/tests/unit/sagemaker/test_studio.py b/tests/unit/sagemaker/test_studio.py index <HASH>..<HASH> 100644 --- a/tests/unit/sagemaker/test_studio.py +++ b/tests/unit/sagemaker/test_studio.py @@ -94,3 +94,11 @@ def test_append_project_tags(tmpdir): {"Key": "sagemaker:project-id", "Value": "proj-1234"}, {"Key": "sagemaker:project-name", "Value": "proj-name"}, ] + + tags = _append_project_tags( + [{"Key": "sagemaker:project-id", "Value": "proj-1234"}], working_dir + ) + assert tags == [ + {"Key": "sagemaker:project-id", "Value": "proj-1234"}, + {"Key": "sagemaker:project-name", "Value": "proj-name"}, + ]
fix: remove duplicated tags in _append_project_tags (#<I>)
aws_sagemaker-python-sdk
train
py,py
3b6aeae05ef14012a6a0acd2d421a27ce672debd
diff --git a/config/database.rb b/config/database.rb index <HASH>..<HASH> 100644 --- a/config/database.rb +++ b/config/database.rb @@ -19,8 +19,8 @@ CREATE TABLE IF NOT EXISTS favorites_tags( id INTEGER PRIMARY KEY AUTOINCREMENT, tag_id INTEGER, favorite_id INTEGER, - FOREIGN KEY(tag_id) REFERENCES tags(id), - FOREIGN KEY(favorite_id) REFERENCES favorites(id), + FOREIGN KEY(tag_id) REFERENCES tags(id) ON DELETE CASCADE, + FOREIGN KEY(favorite_id) REFERENCES favorites(id) ON DELETE CASCADE, UNIQUE(tag_id, favorite_id) ON CONFLICT REPLACE ); SQL diff --git a/test/ruby_pocket/favorite_test.rb b/test/ruby_pocket/favorite_test.rb index <HASH>..<HASH> 100644 --- a/test/ruby_pocket/favorite_test.rb +++ b/test/ruby_pocket/favorite_test.rb @@ -63,6 +63,13 @@ module RubyPocket assert_equal ruby_flow.tags, ruby_tapas.tags end + def test_favorites_with_tags_are_deleted_without_errors + values = build_values(tag_names: %w(one two)) + favorite = Favorite.create values + + assert favorite.destroy + end + private def build_values(values = {})
Delete favorites with tags without FK errors
thiagoa_ruby_pocket
train
rb,rb
1522ab3c4b8f0e26f8a2c2a10e6d8d3d0fe44c0b
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -54,6 +54,8 @@ function request(session, action, options, callback) { pass: session.user.pass, sendImmediately: false // Required for Digest Auth }, + forever: true, + pool: { maxSockets: 20 }, jar: cookiejar, // Preserve Cookies rejectUnauthorized: false // Ignore invalid (expired, self-signed) certificates // requestCert: true, // Let's go with default; this seems to cause failures
trying to increase number of active requests we can fire
retsr_rets.js
train
js
dbabf20faac7f5c458b72448da51ce7cd39dae97
diff --git a/lib/transports/jsonp-polling.js b/lib/transports/jsonp-polling.js index <HASH>..<HASH> 100644 --- a/lib/transports/jsonp-polling.js +++ b/lib/transports/jsonp-polling.js @@ -10,7 +10,7 @@ */ var HTTPPolling = require('./http-polling'); -var jsonpolling_re = /^\d+$/ +var jsonpolling_re = /^\d+$/; /** * Export the constructor. @@ -83,12 +83,12 @@ JSONPPolling.prototype.doWrite = function (data) { HTTPPolling.prototype.doWrite.call(this); var data = data === undefined - ? '' : this.head + JSON.stringify(data) + this.foot; + ? '' + : this.head + JSON.stringify(data) + this.foot; this.response.writeHead(200, { 'Content-Type': 'text/javascript; charset=UTF-8' , 'Content-Length': Buffer.byteLength(data) - , 'Connection': 'Keep-Alive' , 'X-XSS-Protection': '0' });
transports: fix for `Connection: close` [stbuehler] (fixes #<I>)
socketio_socket.io
train
js
ebbf8849cc25e7370a7988b505d6573594388359
diff --git a/meshio/mdpa_io.py b/meshio/mdpa_io.py index <HASH>..<HASH> 100644 --- a/meshio/mdpa_io.py +++ b/meshio/mdpa_io.py @@ -328,7 +328,7 @@ def _write_nodes(fh, points, write_binary = False): else: for k, x in enumerate(points): fh.write( - "\t{}\t{:.8E}\t{:.8E}\t{:.8E}\n".format(k + 1, x[0], x[1], x[2]).encode("utf-8") + "\t{}\t{:.16E}\t{:.16E}\t{:.16E}\n".format(k + 1, x[0], x[1], x[2]).encode("utf-8") ) fh.write("End Nodes\n\n".encode("utf-8")) return
Increasing precission to <I> to avoid error in assert
nschloe_meshio
train
py
e3b62790113cbc760439d3764b5066cebad714be
diff --git a/src/Notifier.php b/src/Notifier.php index <HASH>..<HASH> 100644 --- a/src/Notifier.php +++ b/src/Notifier.php @@ -146,7 +146,7 @@ class Notifier private function newHTTPClient() { if (array_key_exists('httpClient', $this->opt)) { - if ($this->opt['httpClient'] instanceof GuzzleHttp\ClientInterface) { + if ($this->opt['httpClient'] instanceof \GuzzleHttp\ClientInterface) { return $this->opt['httpClient']; } throw new Exception('phpbrake: httpClient must implement GuzzleHttp\ClientInterface');
fix: http client type check in notifier
airbrake_phpbrake
train
php
24915c93a17500738e3c42c5fab96a4adb670fdf
diff --git a/appclient/src/main/java/org/jboss/as/appclient/subsystem/parsing/AppClientXml.java b/appclient/src/main/java/org/jboss/as/appclient/subsystem/parsing/AppClientXml.java index <HASH>..<HASH> 100644 --- a/appclient/src/main/java/org/jboss/as/appclient/subsystem/parsing/AppClientXml.java +++ b/appclient/src/main/java/org/jboss/as/appclient/subsystem/parsing/AppClientXml.java @@ -268,22 +268,7 @@ public class AppClientXml extends CommonXml { } if (element == Element.VAULT) { - switch (namespace) { - //Less than 1.1 does not end up in this method - case DOMAIN_1_1: - case DOMAIN_1_2: - case DOMAIN_1_3: - case DOMAIN_1_4: - case DOMAIN_1_5: - case DOMAIN_2_0: - case DOMAIN_2_1: { - parseVault_1_1(reader, address, namespace, list); - break; - } - default: { - parseVault_3_0(reader, address, namespace, list); - } - } + parseVault(reader, address, namespace, list); element = nextElement(reader, namespace); } // Single profile
[WFLY-<I>] Switch to a version independent parseVault call.
wildfly_wildfly
train
java
f6f626989ce71bd0e5c8efe87f50b41d8a139da0
diff --git a/ploy/__init__.py b/ploy/__init__.py index <HASH>..<HASH> 100644 --- a/ploy/__init__.py +++ b/ploy/__init__.py @@ -405,7 +405,7 @@ class Controller(object): for instance in self.get_instances(command='init_ssh_key'): print instance elif args.command == 'debug': - for instance in self.get_instances(command='startup_script'): + for instance in sorted(self.instances): print instance elif args.command == 'list': for subcmd in sorted(self.list_cmds):
Allow command line completion of all instances for ``debug`` command.
ployground_ploy
train
py
07092744449d6fc66fa0272e0b86134cd5575c85
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index <HASH>..<HASH> 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -11,8 +11,7 @@ Spyder, the Scientific PYthon Development EnviRonment Developped and maintained by the Spyder Development Team -Copyright © 2009 - 2015 Pierre Raybaut -Copyright © 2010 - 2015 The Spyder Development Team +Copyright © 2009- The Spyder Development Team Licensed under the terms of the MIT License (see spyderlib/__init__.py for details) """ @@ -2316,8 +2315,7 @@ class MainWindow(QMainWindow): _("About %s") % "Spyder", """<b>Spyder %s</b> %s <br>The Scientific PYthon Development EnviRonment - <p>Copyright &copy; 2009 - 2015 Pierre Raybaut - <br>Copyright &copy; 2010 - 2015 The Spyder Development Team + <br>Copyright &copy; 2009- The Spyder Development Team <br>Licensed under the terms of the MIT License <p>Created by Pierre Raybaut <br>Developed and maintained by the
Main Window: Fix copyright in "About Spyder" dialog [ci skip]
spyder-ide_spyder
train
py
b084fdeb26eeeedad6782243525c636457b05f09
diff --git a/test/common/compute/server-test.js b/test/common/compute/server-test.js index <HASH>..<HASH> 100644 --- a/test/common/compute/server-test.js +++ b/test/common/compute/server-test.js @@ -21,7 +21,7 @@ var azureOptions = require('../../fixtures/azure/azure-options.json'); // Declaring variables for helper functions defined later var setupImagesMock, setupFlavorMock, setupServerMock, setupGetServersMock, - setupGetServerMock, serverStatusReply; + setupGetServerMock, setupRebootMock, serverStatusReply; azureApi._updateMinimumPollInterval(mock ? 10 : azureApi.MINIMUM_POLL_INTERVAL); @@ -579,6 +579,10 @@ setupGetServerMock = function (client, provider, servers) { } }; +setupRebootMock = function() { + // TODO +}; + // //function batchThree(providerClient, providerName) { // var name = providerName || 'rackspace',
Declaring and defining variable so it can be referenced from skipped test.
pkgcloud_pkgcloud
train
js