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
9dcb3ec005200718d37088b94f158840ec848013
diff --git a/oedialect/dialect.py b/oedialect/dialect.py index <HASH>..<HASH> 100644 --- a/oedialect/dialect.py +++ b/oedialect/dialect.py @@ -236,6 +236,9 @@ class OEExecutionContext(PGExecutionContext): def rowcount(self): return self.cursor.rowcount + def create_server_side_cursor(self): + return self._dbapi_connection.cursor() + class OEDialect(postgresql.psycopg2.PGDialect_psycopg2): ddl_compiler = OEDDLCompiler
Enable server-side cursors
OpenEnergyPlatform_oedialect
train
py
d0bff8209ede88682f248106a19a5b48cd7ffcd9
diff --git a/holoviews/plotting/__init__.py b/holoviews/plotting/__init__.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/__init__.py +++ b/holoviews/plotting/__init__.py @@ -319,7 +319,7 @@ Store.options.GridSpace = Options('style', **{'font.size': 10, 'axes.labelsize': # Annotations Store.options.VLine = Options('style', color=Cycle(key='default_colors')) Store.options.HLine = Options('style', color=Cycle(key='default_colors')) -Store.options.Spline = Options('style', linewidth=2) +Store.options.Spline = Options('style', linewidth=2, ec='r') Store.options.Text = Options('style', fontsize=13) Store.options.Arrow = Options('style', color='k', linewidth=2, fontsize=13) # Paths
Fixed default Spline colour to be distinct from background color
pyviz_holoviews
train
py
3d916d45c1c5d2991230686707191ae13d0de0fc
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -83,12 +83,16 @@ var applySubTrees = function (tree, method) { var execAll = function (tree, msg) { - var subTreeExecution = applySubTrees(tree, function (subtree) { - return execAll(subtree, msg); - }); - return Promise.join(execTree(tree, msg) - , subTreeExecution) - .then(_.any); + return chainExecutions( + function () { + return execTree(tree, msg); + } + , function () { + return applySubTrees(tree, function (subtree) { + return execAll(subtree, msg); + }); + } + ); }; var execMatch = function (target, tree, msg) {
Fix synchronous callback for ** events.
plediii_HevEmitter
train
js
cd682f343a4c460a85a1037aae5d51a1edf35749
diff --git a/source/rafcon/gui/controllers/states_editor.py b/source/rafcon/gui/controllers/states_editor.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/controllers/states_editor.py +++ b/source/rafcon/gui/controllers/states_editor.py @@ -489,6 +489,13 @@ class StatesEditorController(ExtendedController): state_machine_m = model assert isinstance(state_machine_m.selection, Selection) if state_machine_m.selection.get_num_states() == 1 and len(state_machine_m.selection) == 1: + if state_machine_m.selection.get_states()[0].get_state_machine_m() is None or \ + state_machine_m.selection.get_states()[0].get_state_machine_m() is not state_machine_m: + # TODO maybe can be moved to state machine model + logger.warning("Selection of state machine {1} seems to be inconsistent. " + "{0} is not known by state machine {1}." + "".format(state_machine_m.selection.get_states()[0], + state_machine_m.state_machine.state_machine_id)) self.activate_state_tab(state_machine_m.selection.get_states()[0]) @ExtendedController.observe("state_machine", after=True)
states editor: add warning if selection is inconsistent - still performs selection but also mentions this inconsistency -> maybe can be moved to state machine model
DLR-RM_RAFCON
train
py
026c241051dcd4d0dffe906874723b4f3f5f4feb
diff --git a/lib/project_euler_cli/archive_viewer.rb b/lib/project_euler_cli/archive_viewer.rb index <HASH>..<HASH> 100644 --- a/lib/project_euler_cli/archive_viewer.rb +++ b/lib/project_euler_cli/archive_viewer.rb @@ -50,7 +50,7 @@ class ArchiveViewer init_index = @num_problems init_index.downto(init_index - 9) do |i| - puts "#{i} - #{@problems[i]}" + puts "#{i} - #{@recent[i]}" end puts
Actually fix the bug when loading recent problems, instead of just THINKING it is solved
ecssiah_project-euler-cli
train
rb
80c3b98a84a8d9b33871a949c7358d6516f9a988
diff --git a/test/response.test.js b/test/response.test.js index <HASH>..<HASH> 100644 --- a/test/response.test.js +++ b/test/response.test.js @@ -362,6 +362,7 @@ module.exports = { app.get('/', function(req, res){ res.cookie('rememberme', 'yes', { expires: new Date(1), httpOnly: true }); + res.cookie('something', 'else'); res.redirect('/'); }); @@ -369,7 +370,7 @@ module.exports = { { url: '/' }, function(res){ res.headers['set-cookie'] - .should.eql(['rememberme=yes; expires=Thu, 01 Jan 1970 00:00:00 GMT; httpOnly']); + .should.eql(['rememberme=yes; expires=Thu, 01 Jan 1970 00:00:00 GMT; httpOnly', 'something=else']); }); },
Added multiple Set-Cookie header tests
expressjs_express
train
js
4f38ff6cf06c5e90dde80d936ce4bed23dfa4e47
diff --git a/dwave/cloud/client.py b/dwave/cloud/client.py index <HASH>..<HASH> 100644 --- a/dwave/cloud/client.py +++ b/dwave/cloud/client.py @@ -1077,6 +1077,9 @@ class Client(object): except BaseException as err: logger.exception(err) + finally: + session.close() + def _handle_problem_status(self, message, future): """Handle the results of a problem submission or results request. @@ -1219,6 +1222,9 @@ class Client(object): except Exception as err: logger.exception(err) + finally: + session.close() + def _is_clock_diff_acceptable(self, future): if not future or future.clock_diff is None: return False @@ -1377,6 +1383,9 @@ class Client(object): except Exception as err: logger.exception(err) + finally: + session.close() + def _load(self, future): """Enqueue a problem to download results from the server. @@ -1436,6 +1445,9 @@ class Client(object): except Exception as err: logger.error('Load result error: ' + str(err)) + finally: + session.close() + _Problem = collections.namedtuple('_Problem', ['data', 'future']) _ProblemPart = collections.namedtuple('_ProblemPart', ['data', 'no', 'future']) @@ -1484,6 +1496,8 @@ class Client(object): except Exception as exc: logger.exception('Problem upload error', exc) + session.close() + def _do_upload_part(self): while True: try:
Close per-thread sessions on shutdown
dwavesystems_dwave-cloud-client
train
py
45632876ca533b20ff57070768c0ed0a50c12b9b
diff --git a/src/renderers/canvas.js b/src/renderers/canvas.js index <HASH>..<HASH> 100644 --- a/src/renderers/canvas.js +++ b/src/renderers/canvas.js @@ -273,6 +273,8 @@ Physics.renderer('canvas', function( proto ){ hiddenCtx.restore(); view.src = hiddenCanvas.toDataURL("image/png"); + view.width = hiddenCanvas.width; + view.height = hiddenCanvas.height; return view; }, @@ -332,4 +334,4 @@ Physics.renderer('canvas', function( proto ){ } } }; -}); \ No newline at end of file +});
fix the problem that sometimes the body been rendered in the wrong position in ie<I> I don't know whether to add two temporary variables to store the values of "2 * hw + 2 + (2 * styles.lineWidth|0)" and "2 * hh + 2 + (2 * styles.lineWidth|0)",then assign them to hiddenCanvas.width,hiddenCanvas.height,view.width and view.height for improving a little performance.
wellcaffeinated_PhysicsJS
train
js
b843a694a5c088a5cf602831bfe3540cde03acb2
diff --git a/lib/nrser/core_ext/array.rb b/lib/nrser/core_ext/array.rb index <HASH>..<HASH> 100644 --- a/lib/nrser/core_ext/array.rb +++ b/lib/nrser/core_ext/array.rb @@ -115,7 +115,7 @@ class Array when 0 raise NRSER::CountError.new \ "Can not create getter proc from empty array", - subject: self, + value: self, expected: '> 0', count: count when 1
Change CountError creation re refactor
nrser_nrser.rb
train
rb
427bda0e322167036b57f37e8e528d4d128fa43a
diff --git a/carrot/messaging.py b/carrot/messaging.py index <HASH>..<HASH> 100644 --- a/carrot/messaging.py +++ b/carrot/messaging.py @@ -569,12 +569,12 @@ class Publisher(object): The default delivery mode used for messages. The value is an integer. The following delivery modes are supported by (at least) RabbitMQ: - * 1 + * 1 or Publisher.NONE_PERSISTENT_DELIVERY_MODE The message is non-persistent. Which means it is stored in memory only, and is lost if the server dies or restarts. - * 2 + * 2 or Publisher.PERSISTENT_DELIVERY_MODE The message is persistent. Which means the message is stored both in-memory, and on disk, and therefore preserved if the server dies or restarts. @@ -612,9 +612,12 @@ class Publisher(object): """ + NONE_PERSISTENT_DELIVERY_MODE = 1 + PERSISTENT_DELIVERY_MODE = 2 + exchange = "" routing_key = "" - delivery_mode = 2 # Persistent + delivery_mode = Publisher.PERSISTENT_DELIVERY_MODE # Persistent _closed = True exchange_type = "direct" durable = True
Add intent revealing names for use with the delivery_mode attribute
ask_carrot
train
py
423bb90c717e913ef4a26f87c006e9738cb46683
diff --git a/authority/admin.py b/authority/admin.py index <HASH>..<HASH> 100644 --- a/authority/admin.py +++ b/authority/admin.py @@ -87,6 +87,10 @@ def edit_permissions(modeladmin, request, queryset): if all_valid(formsets): for formset in formsets: formset.save() + else: + modeladmin.message_user(request, '; '.join( + err.as_text() for formset in formsets for err in formset.errors + )) # redirect to full request path to make sure we keep filter return HttpResponseRedirect(request.get_full_path())
Show action form errors using message_user Not very neat, but way better than nothing when there are errors (previously the error was invisible and the action simply seemed to have completed).
jazzband_django-authority
train
py
6ccfca342856bf59654e6d846f4c6ed811c13415
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,8 +11,8 @@ var platform = os.platform(); var arch = os.arch(); var sliceDir = path.resolve(path.join(__dirname, 'ice', 'slice')); -var slice2js = path.join(path.join(__dirname, 'build', 'Release'), - platform === 'win32' ? 'slice2js.exe' : 'slice2js'); +var slice2js = path.resolve(path.join(path.join(__dirname, 'build', 'Release'), + platform === 'win32' ? 'slice2js.exe' : 'slice2js')); function compile(args, options) { @@ -24,3 +24,4 @@ function compile(args, options) module.exports.compile = compile; module.exports.sliceDir = sliceDir; +module.exports.slice2js = slice2js;
Add slice2js executable path to exports
zeroc-ice_npm-slice2js
train
js
eea6dd57c9b8a562fb3dd878fd8ef43ec1e6051b
diff --git a/lib/rspec-puppet/matchers/create_generic.rb b/lib/rspec-puppet/matchers/create_generic.rb index <HASH>..<HASH> 100644 --- a/lib/rspec-puppet/matchers/create_generic.rb +++ b/lib/rspec-puppet/matchers/create_generic.rb @@ -17,7 +17,7 @@ module RSpec::Puppet def without(*args, &block) params = args.shift - @expected_undef_params = (@expected_undef_params || []) | params.to_a + @expected_undef_params = (@expected_undef_params || []) | Array(params) self end
String#to_a doesn't work under <I>
rodjek_rspec-puppet
train
rb
c0e7109e857c58a0c9129309d52b02ffa0e3093f
diff --git a/lib/instrumental/version.rb b/lib/instrumental/version.rb index <HASH>..<HASH> 100644 --- a/lib/instrumental/version.rb +++ b/lib/instrumental/version.rb @@ -1,3 +1,3 @@ module Instrumental - VERSION = "0.5.0" + VERSION = "0.5.1" end
Version bump to <I>.
Instrumental_instrumental_agent-ruby
train
rb
054267bc74aa39fca99c8edd40530b100d648893
diff --git a/test/test-reconnection.js b/test/test-reconnection.js index <HASH>..<HASH> 100644 --- a/test/test-reconnection.js +++ b/test/test-reconnection.js @@ -120,10 +120,15 @@ exec('which rabbitmqctl', function(err,res){ } }); }); + // also create a temp queue, which shouldn't be recreated on reconnection, - // because declaring amq.* named queues are forbidden + // because declaring amq.* named queues is forbidden + var tempQueueMsgCount = 0; connection.queue('', {autoDelete: true, durable: false, exclusive: true}, function (q) { - queue.bind(exchange, '#'); + q.bind(exchange, 'tmp.*'); + q.subscribe(function (message) { + tempQueueMsgCount += 1; + }); }); } else if (readyCount === 2) { // Ensure that the backoff timeline is approximately correct. We
in reconnect test bind and subscribe the temp queue
postwait_node-amqp
train
js
3a052f55564c09c0eb322b73f43631698b6e0437
diff --git a/test/unit/Reflection/ReflectionClassTest.php b/test/unit/Reflection/ReflectionClassTest.php index <HASH>..<HASH> 100644 --- a/test/unit/Reflection/ReflectionClassTest.php +++ b/test/unit/Reflection/ReflectionClassTest.php @@ -459,6 +459,8 @@ class ReflectionClassTest extends TestCase self::assertTrue($property->isPublic()); self::assertTrue($property->isReadOnly()); + self::assertFalse($property->isPromoted()); + self::assertTrue($property->isDefault()); self::assertSame(0, $property->getPositionInAst()); } @@ -479,6 +481,8 @@ class ReflectionClassTest extends TestCase self::assertTrue($property->isPublic(), $propertyName); self::assertTrue($property->isReadOnly(), $propertyName); + self::assertFalse($property->isPromoted()); + self::assertTrue($property->isDefault()); self::assertSame(0, $property->getPositionInAst(), $propertyName); } }
Improved tests for default enum properties
Roave_BetterReflection
train
php
be8a6a5c642f267650f56a00931640e46f880e07
diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -1244,6 +1244,11 @@ class InnerBrowser extends Module implements Web, PageSourceSaver, ElementLocato $this->debugSection('Response Headers', $this->getRunningClient()->getInternalResponse()->getHeaders()); } + public function _getResponseStatusCode() + { + return $this->getResponseStatusCode(); + } + protected function getResponseStatusCode() { // depending on Symfony version
Please set getResponseStatusCode as public (#<I>) * switch from protected to public for getResponseStatusCode * ReAdd Useless Space * use _ for public exposed method (as requested)
Codeception_base
train
php
d09baeaf85d4a147fd7be53af1aa490ad83abe25
diff --git a/spec/unit/upnp/ssdp_spec.rb b/spec/unit/upnp/ssdp_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/upnp/ssdp_spec.rb +++ b/spec/unit/upnp/ssdp_spec.rb @@ -130,6 +130,14 @@ describe UPnP::SSDP do end end + describe '.notify' do + pending 'Implementation of UPnP Devices' + end + + describe '.send_notification' do + pending 'Implementation of UPnP Devices' + end + =begin context 'by default' do it "searches for 'ssdp:all'" do
Note that .notify isn't yet implemented
turboladen_playful
train
rb
35c53352983a79b600e63b40ce96cf119353d3b2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,14 +5,14 @@ var bearing = require('turf-bearing'); var destination = require('turf-destination'); /** - * Slices a LineString at start and stop Points + * Takes a line, a start point, and a stop point and returns the line in between those points * * @module turf/line-slice * @category misc - * @param {Point} Point to start the slice - * @param {Point} Point to stop the slice - * @param {LineString} Line to slice - * @return {LineString} Sliced LineString + * @param {Feature<Point>} point1 starting point + * @param {Feature<Point>} point2 stopping point + * @param {Feature<LineString>} line line to slice + * @return {Feature<LineString>} sliced line * @example * var line = { * "type": "Feature",
Switch doc to closure compiler templating
turf-junkyard_turf-line-slice
train
js
c4cd66ea1b8514cc9e7365edd4e0c0b586a13923
diff --git a/linkcheck/decorators.py b/linkcheck/decorators.py index <HASH>..<HASH> 100644 --- a/linkcheck/decorators.py +++ b/linkcheck/decorators.py @@ -94,7 +94,7 @@ def synchronize (lock, func, log_duration_secs=0): t = time.time() with lock: duration = time.time() - t - if log_duration_secs and duration > log_duration_secs: + if duration > log_duration_secs > 0: print >> sys.stderr, "WARN:", func.__name__, "locking took %0.2f seconds" % duration return func(*args, **kwargs) return update_func_meta(newfunc, func)
Simplify decorator duration check logic.
wummel_linkchecker
train
py
12e0f839f98a92ec4aea6b0c34a6ee8022b6c600
diff --git a/src/EventListener/LoggerListener.php b/src/EventListener/LoggerListener.php index <HASH>..<HASH> 100644 --- a/src/EventListener/LoggerListener.php +++ b/src/EventListener/LoggerListener.php @@ -3,6 +3,7 @@ namespace Stampie\Extra\EventListener; use Psr\Log\LoggerInterface; +use Psr\Log\LogLevel; use Stampie\Extra\Event\MessageEvent; use Stampie\Extra\StampieEvents; use Stampie\Util\IdentityUtils; @@ -15,9 +16,12 @@ class LoggerListener implements EventSubscriberInterface { private $logger; - public function __construct(LoggerInterface $logger = null) + private $logLevel; + + public function __construct(LoggerInterface $logger = null, $logLevel = LogLevel::DEBUG) { $this->logger = $logger; + $this->logLevel = $logLevel; } /** @@ -38,7 +42,8 @@ class LoggerListener implements EventSubscriberInterface $message = $event->getMessage(); - $this->logger->debug( + $this->logger->log( + $this->logLevel, sprintf('Sending an email from "%s" to "%s"', IdentityUtils::buildIdentityString($message->getFrom()), IdentityUtils::buildIdentityString($message->getTo())), ['subject' => $message->getSubject(), 'headers' => $message->getHeaders()] );
Allow caller to define log level for listener The current implementation always uses debug as log level. This makes the logger less flexible as it requires the caller to use debug log level for all logging to see the output. This change allows the caller to set the desired log level in the constructor. The default is still debug to retain current behavior.
Stampie_extra
train
php
bc07e134a4a71e336e1a370029a25a8a4151fefb
diff --git a/lib/markaby/rails.rb b/lib/markaby/rails.rb index <HASH>..<HASH> 100644 --- a/lib/markaby/rails.rb +++ b/lib/markaby/rails.rb @@ -27,10 +27,10 @@ module Markaby # "1.1.5", # "1.1.6", # "1.2.0", - # "1.2.1", - # "1.2.2", - # "1.2.3", - # "1.2.4", + "1.2.1", + "1.2.2", + "1.2.3", + "1.2.4", "1.2.5", "1.2.6", ]
Enable rails <I>-<I> (it's passing)
markaby_markaby
train
rb
8dd573df3c2ca2290f20b07f0635c028c4cd0a0c
diff --git a/config/application.rb b/config/application.rb index <HASH>..<HASH> 100644 --- a/config/application.rb +++ b/config/application.rb @@ -8,9 +8,6 @@ Bundler.require(*Rails.groups) module Gemcutter class Application < Rails::Application - def config_for(name, env = Rails.env) - YAML.load_file(Rails.root.join("config/#{name}.yml"))[env] - end config.rubygems = Application.config_for :rubygems config.time_zone = "UTC"
don't need define config_for anymore
rubygems_rubygems.org
train
rb
2ded2bf71a1222384af096261783db2f7392a20e
diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java @@ -112,8 +112,8 @@ class FlywayPropertiesTests { // Property that moved to a separate SQL plugin ignoreProperties(properties, "sqlServerKerberosLoginFile"); // High level object we can't set with properties - ignoreProperties(configuration, "callbacks", "dataSource", "javaMigrations", "javaMigrationClassProvider", - "resourceProvider", "resolvers"); + ignoreProperties(configuration, "callbacks", "classLoader", "dataSource", "javaMigrations", + "javaMigrationClassProvider", "resourceProvider", "resolvers"); // Properties we don't want to expose ignoreProperties(configuration, "resolversAsClassNames", "callbacksAsClassNames", "loggers", "driver"); // Handled by the conversion service
Adapt to latest change in Spring Framework snapshots
spring-projects_spring-boot
train
java
f7df4959661f43a761c65fb4d6be8ac7affdbf5c
diff --git a/visidata/vdtui.py b/visidata/vdtui.py index <HASH>..<HASH> 100755 --- a/visidata/vdtui.py +++ b/visidata/vdtui.py @@ -1004,7 +1004,13 @@ class BaseSheet: def getCommand(self, keystrokes_or_longname): longname = bindkeys.get(keystrokes_or_longname) - return commands.get(longname if longname else keystrokes_or_longname) + try: + if longname: + return commands.get(longname) or error('no command "%s"' % longname) + else: + return commands.get(keystrokes_or_longname) or error('no binding for %s' % keystrokes_or_longname) + except Exception: + return None def __bool__(self): 'an instantiated Sheet always tests true' @@ -1027,7 +1033,7 @@ class BaseSheet: def exec_command(self, cmd, args='', vdglobals=None, keystrokes=None): "Execute `cmd` tuple with `vdglobals` as globals and this sheet's attributes as locals. Returns True if user cancelled." if not cmd: - status('no command "%s"' % keystrokes) + debug('no command "%s"' % keystrokes) return True if isinstance(cmd, CommandLog):
[vdtui] be specific with error msgs in getCommand
saulpw_visidata
train
py
4d11c933ac358015d5cd8c75bd62386c9d924074
diff --git a/lib/kernel.js b/lib/kernel.js index <HASH>..<HASH> 100644 --- a/lib/kernel.js +++ b/lib/kernel.js @@ -105,12 +105,6 @@ Kernel.prototype._demandResolveable = function(key) { return resolveable }) }.bind(this)) - /* synchronous - var resolveable = ResolveableComponentModel.fromModel.call(this,model) - resolveable = this._decorate(resolveable) - this.register(resolveable) - return resolveable - */ } Kernel.prototype._decorate = function(resolveable) { //decorate if possible @@ -134,8 +128,6 @@ Kernel.prototype._decorate = function(resolveable) { Kernel.prototype.resolve = function(key, deps) { //lazily make the component resolveable - //var model = this._demandResolveable(key) - return this._demandResolveable(key) .then(function(model){ return this.createContext(model, deps)
promisified internal demandResolveable
mnichols_ankh
train
js
7213316076531f8a65d4684dc8bebb12eddc3eda
diff --git a/lib/omnibus/licensing.rb b/lib/omnibus/licensing.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/licensing.rb +++ b/lib/omnibus/licensing.rb @@ -657,6 +657,7 @@ EOH "AGPL-3.0", # GNU Affero General Public License v3 "GPL-2.0", # GNU General Public License version 2.0 "GPL-3.0", # GNU General Public License version 3.0 + "LGPL-2.0", # GNU Library or "Lesser" General Public License version 2.0 "LGPL-2.1", # GNU Library or "Lesser" General Public License version 2.1 "LGPL-3.0", # GNU Library or "Lesser" General Public License version 3.0 "HPND", # Historical Permission Notice and Disclaimer
licensing: Add support of LGPL-<I> It was superseded by the GNU Lesser General Public License (LGPL-<I> and higher), but there are still projects licensed under LGPL-<I>.
chef_omnibus
train
rb
a394fdf55f628b914f1ad4fb31b9e148e18bc0df
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -87,11 +87,10 @@ Parser.prototype._write = function (chunk, encoding, cb) { if (this._headerData.contentLength === 0) { this._emitMessage(this._headerData.message); - return cb(null); + } else { + this._collectingContent = this._headerData.contentLength; } - this._collectingContent = this._headerData.contentLength; - } else { if (this._buffer.length < this._collectingContent) {
Don't `return` from parser when there's no body. This interferes with the loop we're building. Instead, change the if-statement to an if-else to accomplish the same here.
stephen_httplike
train
js
f120867a0614b4ec8563a7dc668d858f2e968c79
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,11 +3,19 @@ from setuptools import setup +try: + from pypandoc import convert + read_md = lambda f: convert(f, 'rst') +except ImportError: + print("warning: pypandoc module not found, could not convert Markdown to RST") + read_md = lambda f: open(f, 'r').read() + + setup(name='baron', version='0.2', description='Full Syntax Tree for python to make writing refactoring code a realist task', author='Laurent Peuch', - long_description=open("README.md", "r").read(), + long_description=read_md("README.md"), author_email='[email protected]', url='https://github.com/Psycojoker/baron', install_requires=['rply'],
[enh] convert md README to rst on release
PyCQA_baron
train
py
00b9df162dc8126decfab3d7d2892e42078eb553
diff --git a/common/entities/Category.php b/common/entities/Category.php index <HASH>..<HASH> 100755 --- a/common/entities/Category.php +++ b/common/entities/Category.php @@ -165,8 +165,9 @@ class Category extends ActiveRecord if (!empty($imageName)) { $fullPath = \Yii::$app->shop_imagable ->get($imagableCategory, $size, $imageName); - $path = str_replace('backend', '', Yii::$app->basePath); - return str_replace($path . '/web', '', $fullPath); + $path = str_replace('frontend', '', Yii::$app->basePath); + $path = str_replace('backend', '', $path); + return str_replace($path . 'frontend/web', '', $fullPath); } else return ''; }
Fixes getImage() method in Category model.
black-lamp_blcms-shop
train
php
37a8ce5534bf0e76d10a467ddcbf389c96504a54
diff --git a/pygccxml/declarations/type_traits.py b/pygccxml/declarations/type_traits.py index <HASH>..<HASH> 100644 --- a/pygccxml/declarations/type_traits.py +++ b/pygccxml/declarations/type_traits.py @@ -187,14 +187,17 @@ def array_size(type): assert isinstance( nake_type, cpptypes.array_t ) return nake_type.size -def array_item_type(type): +def array_item_type(type_): """returns array item type""" - assert is_array(type) - nake_type = remove_alias( type ) - nake_type = remove_reference( nake_type ) - nake_type = remove_cv( nake_type ) - return nake_type.base - + if is_array(type_): + type_ = remove_alias( type_ ) + type_ = remove_cv( type_ ) + return type_.base + elif is_pointer( type_ ): + return remove_pointer( type_ ) + else: + assert 0 + def remove_reference(type): """removes reference from the type definition
array_item_type now can treat row pointer.
gccxml_pygccxml
train
py
59ca27501a899106cb4a6634bb1776a30e6fcb61
diff --git a/src/sos/tasks.py b/src/sos/tasks.py index <HASH>..<HASH> 100644 --- a/src/sos/tasks.py +++ b/src/sos/tasks.py @@ -681,10 +681,11 @@ def check_task(task): def has_res(): return os.path.isfile(res_file) and os.stat(res_file).st_mtime >= os.stat(task_file).st_mtime - job_file = os.path.join(os.path.expanduser('~'), '.sos', 'tasks', task + '.sh') - def has_job(): - return os.path.isfile(job_file) and os.stat(job_file).st_mtime >= os.stat(task_file).st_mtime + job_file = os.path.join(os.path.expanduser('~'), '.sos', 'tasks', task + '.sh') + job_id_file = os.path.join(os.path.expanduser('~'), '.sos', 'tasks', task + '.job_id') + return os.path.isfile(job_file) and os.stat(job_file).st_mtime >= os.stat(task_file).st_mtime \ + and os.path.isfile(job_id_file) and os.stat(job_id_file).st_mtime >= os.stat(job_file).st_mtime if has_res(): try:
Revised status pending to consider job_id #<I>
vatlab_SoS
train
py
e9f1f4dc69dce1c0f145642d271fb09c86928c1f
diff --git a/tests/proxy/map_test.py b/tests/proxy/map_test.py index <HASH>..<HASH> 100644 --- a/tests/proxy/map_test.py +++ b/tests/proxy/map_test.py @@ -5,7 +5,7 @@ from hazelcast.proxy.map import EntryEventType from hazelcast.serialization.api import IdentifiedDataSerializable from hazelcast.serialization.predicate import SqlPredicate from tests.base import SingleMemberTestCase -from tests.util import random_string, event_collector, fill_map +from tests.util import random_string, event_collector, fill_map, set_attr from hazelcast import six from hazelcast.six.moves import range @@ -557,6 +557,7 @@ class MapStoreTest(SingleMemberTestCase): self.map.evict_all() self.assertEqual(self.map.size(), 0) + @set_attr(category=3.11) def test_add_entry_listener_item_loaded(self): collector = event_collector() self.map.add_entry_listener(include_value=True, loaded_func=collector) @@ -569,4 +570,4 @@ class MapStoreTest(SingleMemberTestCase): event = collector.events[0] self.assertEntryEvent(event, key='key', value='value', event_type=EntryEventType.loaded) - self.assertTrueEventually(assert_event, 10) \ No newline at end of file + self.assertTrueEventually(assert_event, 10)
add <I> test category to test_add_entry_listener_item_loaded (#<I>) test since EntryLoaded event is added on IMDG <I>
hazelcast_hazelcast-python-client
train
py
e5ac7b613971b0474afdbe0f31a5a0fdb5c5034e
diff --git a/spec/adhearsion/dialplan_controller_spec.rb b/spec/adhearsion/dialplan_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/adhearsion/dialplan_controller_spec.rb +++ b/spec/adhearsion/dialplan_controller_spec.rb @@ -4,8 +4,7 @@ module Adhearsion describe DialplanController do include CallControllerTestHelpers - subject { Adhearsion::DialplanController.new call } - + it { should be_a DialplanController } it { should be_a CallController } let :dialplan do diff --git a/spec/support/call_controller_test_helpers.rb b/spec/support/call_controller_test_helpers.rb index <HASH>..<HASH> 100644 --- a/spec/support/call_controller_test_helpers.rb +++ b/spec/support/call_controller_test_helpers.rb @@ -5,7 +5,7 @@ module CallControllerTestHelpers test_case.let(:call_id) { rand } test_case.let(:call) { Adhearsion::Call.new } - test_case.subject { Adhearsion::CallController.new call } + test_case.subject { test_case.describes.new call } test_case.before do flexmock(Adhearsion::Plugin).should_receive(:methods_scope).once.and_return({:dialplan => Module.new { def foo; end}})
[CS] Call controller spec helpers should instantiate the described object, not always a CallController
adhearsion_adhearsion
train
rb,rb
725202120c141fde7fa790f66b8548b7eb9cc33e
diff --git a/gcs/gcstesting/bucket_tests.go b/gcs/gcstesting/bucket_tests.go index <HASH>..<HASH> 100644 --- a/gcs/gcstesting/bucket_tests.go +++ b/gcs/gcstesting/bucket_tests.go @@ -1409,7 +1409,7 @@ func (t *composeTest) TwoSimpleSources() { ExpectEq(len("tacoburrito"), o.Size) ExpectEq("", o.ContentEncoding) ExpectEq(2, o.ComponentCount) - ExpectThat(o.MD5, Pointee(DeepEquals(md5.Sum([]byte("tacoburrito"))))) + ExpectEq(nil, o.MD5) ExpectEq(computeCrc32C("tacoburrito"), o.CRC32C) ExpectThat(o.MediaLink, MatchesRegexp("download/storage.*foo")) ExpectEq(nil, o.Metadata)
Oops, composite objects don't have an MD5 field. As documented.
jacobsa_gcloud
train
go
31ff5697dcf137d1fdb2b90ad353b1663182e340
diff --git a/plenum/__init__.py b/plenum/__init__.py index <HASH>..<HASH> 100644 --- a/plenum/__init__.py +++ b/plenum/__init__.py @@ -5,6 +5,10 @@ plenum package from __future__ import absolute_import, division, print_function import sys +import plenum if sys.version_info < (3, 5, 0): raise ImportError("Python 3.5.0 or later required.") + +import importlib +from .__metadata__ import *
Hotfix: Deps (#<I>)
hyperledger_indy-plenum
train
py
7f31beb50c2c58ed8b6702f0688f2bfe65daf65e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,8 @@ module.exports = function(filePath) { var dom = cheerio.load(markup, { decodeEntities: false, - xmlMode: false + xmlMode: false, + lowerCaseAttributeNames: false } ); injectSvg(dom);
configure cheerio html parser to allow for camelCase attributes
viktorlarsson_gulp-inject-svg
train
js
b1f13997576a6200697f22a7b7ff9b9a17a1b2f7
diff --git a/packages/components/bolt-animate/src/animate.js b/packages/components/bolt-animate/src/animate.js index <HASH>..<HASH> 100644 --- a/packages/components/bolt-animate/src/animate.js +++ b/packages/components/bolt-animate/src/animate.js @@ -134,12 +134,17 @@ class BoltAnimate extends withLitHtml() { }) { this._animStyle = { animationName, - animationDuration: `${animationDuration}ms`, - animationDelay: `${animationDelay}ms`, + // Safari breaks with 0ms animation-duration + animationDuration: `${Math.max(1, animationDuration)}ms`, animationFillMode, animationTimingFunction, animationIterationCount, }; + + // Safari breaks with 0ms animation-delay + if (animationDelay > 0) { + this._animStyle.animationDelay = `${animationDelay}ms`; + } } triggerAnimIn() {
fix(bolt-animate): safari animation fixes
bolt-design-system_bolt
train
js
0ca4f560eeefbeeacc08621d1ebfc57c9cb89175
diff --git a/src/rest/simple.js b/src/rest/simple.js index <HASH>..<HASH> 100644 --- a/src/rest/simple.js +++ b/src/rest/simple.js @@ -51,7 +51,6 @@ export default (apiUrl) => { }; case CRUD_CREATE: return { - id: json.id, data: { ...payload.data, id: json.id }, }; default:
Simplify CRUD_CREATE success response
marmelab_react-admin
train
js
2efee338cc08933b6e6adb765a015e9c9b55be3e
diff --git a/intranet/apps/eighth/views/admin/attendance.py b/intranet/apps/eighth/views/admin/attendance.py index <HASH>..<HASH> 100644 --- a/intranet/apps/eighth/views/admin/attendance.py +++ b/intranet/apps/eighth/views/admin/attendance.py @@ -168,7 +168,7 @@ def after_deadline_signup_view(request): .filter(after_deadline=True, time__gte=start_date, time__lte=end_date) - .order_by("time")) + .order_by("-time")) context = { "admin_page_title": "After Deadline Signups",
Descending time sort on after deadline
tjcsl_ion
train
py
666f57a35e04790d33e72978105d4c7488e4db18
diff --git a/src/main/java/org/jboss/netty/example/proxy/HexDumpProxyInboundHandler.java b/src/main/java/org/jboss/netty/example/proxy/HexDumpProxyInboundHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/netty/example/proxy/HexDumpProxyInboundHandler.java +++ b/src/main/java/org/jboss/netty/example/proxy/HexDumpProxyInboundHandler.java @@ -80,7 +80,7 @@ public class HexDumpProxyInboundHandler extends SimpleChannelUpstreamHandler { inboundChannel.setReadable(true); } else { // Close the connection if the connection attempt has failed. - future.getChannel().close(); + inboundChannel.close(); } } });
Fixed a bug where a wrong channel is closed on connection failure
netty_netty
train
java
be22461ec263fc5e38a942f6ef52d3ff990ef5f5
diff --git a/src/Surfnet/StepupMiddlewareClientBundle/DependencyInjection/SurfnetStepupMiddlewareClientExtension.php b/src/Surfnet/StepupMiddlewareClientBundle/DependencyInjection/SurfnetStepupMiddlewareClientExtension.php index <HASH>..<HASH> 100644 --- a/src/Surfnet/StepupMiddlewareClientBundle/DependencyInjection/SurfnetStepupMiddlewareClientExtension.php +++ b/src/Surfnet/StepupMiddlewareClientBundle/DependencyInjection/SurfnetStepupMiddlewareClientExtension.php @@ -59,7 +59,7 @@ class SurfnetStepupMiddlewareClientExtension extends Extension private function configureMiddlewareCommandApiUrl(array $config, ContainerBuilder $container) { $guzzle = $container->getDefinition('surfnet_stepup_middleware_client.guzzle.commands'); - $guzzle->replaceArgument(0, ['base_url' => $config['url']['command_api']]); + $guzzle->replaceArgument(0, ['base_uri' => $config['url']['command_api']]); } /**
Conform to new Guzzle 6 API for command API as well
OpenConext_Stepup-Middleware-clientbundle
train
php
bda62e455eb97f6dea1e9ee52afaaed2117a1558
diff --git a/client/rpc/client.go b/client/rpc/client.go index <HASH>..<HASH> 100644 --- a/client/rpc/client.go +++ b/client/rpc/client.go @@ -262,7 +262,8 @@ func SignAndBroadcast(chainID string, nodeClient client.NodeClient, keyClient ke if broadcast { if wait { - wsClient, err := nodeClient.DeriveWebsocketClient() + var wsClient client.NodeWebsocketClient + wsClient, err = nodeClient.DeriveWebsocketClient() if err != nil { return nil, err }
Client: fix shadowed error value in SignAndBroadcast
hyperledger_burrow
train
go
93d8b0d917e805360649ebfdae9c223494943faa
diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index <HASH>..<HASH> 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -29,6 +29,11 @@ def load_file(filepath: _Path) -> dict: def validate(config: dict, filepath: _Path) -> bool: from . import _validate_pyproject as validator + trove_classifier = validator.FORMAT_FUNCTIONS.get("trove-classifier") + if hasattr(trove_classifier, "_disable_download"): + # Improve reproducibility by default. See issue 31 for validate-pyproject. + trove_classifier._disable_download() # type: ignore + try: return validator.validate(config) except validator.ValidationError as ex:
Disable automatic download of trove classifiers by default This helps to improve reproducibility. See #abravalheri/validate-pyproject#<I>.
pypa_setuptools
train
py
e933972d03f7ca1119fd9065f13eabd942945781
diff --git a/announce.go b/announce.go index <HASH>..<HASH> 100644 --- a/announce.go +++ b/announce.go @@ -137,10 +137,16 @@ func (a *Announce) gotNodeAddr(addr Addr) { func (a *Announce) contact(addr Addr) { a.numContacted++ a.triedAddrs.Add([]byte(addr.String())) - if err := a.getPeers(addr); err != nil { - return - } a.pending++ + go func() { + err := a.getPeers(addr) + if err == nil { + return + } + a.mu.Lock() + a.transactionClosed() + a.mu.Unlock() + }() } func (a *Announce) maybeClose() {
Don't hold the Announce lock when calling Announce.getPeers
anacrolix_dht
train
go
34835a18ae9e0207f0a1eb26a00d78a095042e68
diff --git a/lib/pdf/reader/page.rb b/lib/pdf/reader/page.rb index <HASH>..<HASH> 100644 --- a/lib/pdf/reader/page.rb +++ b/lib/pdf/reader/page.rb @@ -63,13 +63,12 @@ module PDF } end - # returns the plain text content of this page encoded as UTF-8 that has - # been layed out in a manner somewhat reflecting the source. Any + # returns the plain text content of this page encoded as UTF-8. Any # characters that can't be translated will be returned as a ▯ # def text - receiver = PDF::Reader::PageTextReceiver.new - walk receiver + receiver = PageTextReceiver.new + walk(receiver) receiver.content end alias :to_s :text
remove noise from Page class * There's now no difference in the Page class on this feature branch and master
yob_pdf-reader
train
rb
db5739474106b74a27f054ed02a405beed6057b9
diff --git a/stdlib/sql_test.go b/stdlib/sql_test.go index <HASH>..<HASH> 100644 --- a/stdlib/sql_test.go +++ b/stdlib/sql_test.go @@ -9,7 +9,7 @@ import ( ) func openDB(t *testing.T) *sql.DB { - db, err := sql.Open("pgx", "postgres://pgx_md5:secret@localhost:5432/pgx_test") + db, err := sql.Open("pgx", "postgres://pgx_md5:[email protected]:5432/pgx_test") if err != nil { t.Fatalf("sql.Open failed: %v", err) }
test ipv4 for travis simplicity
jackc_pgx
train
go
68276186011d6623adb3c00b1b061ad80d4632c3
diff --git a/spyder/otherplugins.py b/spyder/otherplugins.py index <HASH>..<HASH> 100644 --- a/spyder/otherplugins.py +++ b/spyder/otherplugins.py @@ -103,27 +103,20 @@ def _import_module_from_path(module_name, plugin_path): Return None if no module is found. """ module = None - if PY2: - info = imp.find_module(module_name, [plugin_path]) - if info: - module = imp.load_module(module_name, *info) - elif sys.version_info[0:2] <= (3, 3): - loader = importlib.machinery.PathFinder.find_module( - module_name, - [plugin_path]) - if loader: - module = loader.load_module(module_name) - else: # Python 3.4+ - spec = importlib.machinery.PathFinder.find_spec( - module_name, - [plugin_path]) - if spec: - # Needed to prevent an error when 'spec.loader' is None - # See issue 6518 - try: + try: + if PY2: + info = imp.find_module(module_name, [plugin_path]) + if info: + module = imp.load_module(module_name, *info) + else: # Python 3.4+ + spec = importlib.machinery.PathFinder.find_spec( + module_name, + [plugin_path]) + if spec: module = spec.loader.load_module(module_name) - except AttributeError: - module = None + except Exception: + pass + return module
Catch any error when trying to load third-party plugins
spyder-ide_spyder
train
py
c91bf47b73bd08eff4a52c69e848947d632181fb
diff --git a/tests/pyalveo_test.py b/tests/pyalveo_test.py index <HASH>..<HASH> 100644 --- a/tests/pyalveo_test.py +++ b/tests/pyalveo_test.py @@ -208,10 +208,10 @@ class ClientTest(unittest.TestCase): # get annotations for this item of type 'speaker' anns = item_with.get_annotations(type=u'http://ns.ausnc.org.au/schemas/annotation/ice/speaker') - self.assertEqual(anns.keys(), [u'commonProperties', u'@context', u'alveo:annotations']) + self.assertListEqual(sorted(anns.keys()), [u'@context', u'alveo:annotations', u'commonProperties']) ann = anns['alveo:annotations'][0] - self.assertEqual(ann.keys(), [u'type', u'end', u'@id', u'@type', u'start']) + self.assertEqual(sorted(ann.keys()), [u'@id', u'@type', u'end', u'start', u'type']) # this one has no annotations anns = item_without.get_annotations(type=u'http://ns.ausnc.org.au/schemas/annotation/ice/speaker')
Make test more robust to ordering changes.
Alveo_pyalveo
train
py
826a5219dacb9922aef74ecbc2b53e5059017339
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index <HASH>..<HASH> 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -557,6 +557,7 @@ const ( // owner: @andrewsykim // kep: http://kep.k8s.io/1672 // alpha: v1.20 + // beta: v1.22 // // Enable Terminating condition in Endpoint Slices. EndpointSliceTerminatingCondition featuregate.Feature = "EndpointSliceTerminatingCondition" @@ -854,7 +855,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS IPv6DualStack: {Default: true, PreRelease: featuregate.Beta}, EndpointSlice: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 EndpointSliceProxying: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 - EndpointSliceTerminatingCondition: {Default: false, PreRelease: featuregate.Alpha}, + EndpointSliceTerminatingCondition: {Default: true, PreRelease: featuregate.Beta}, ProxyTerminatingEndpoints: {Default: false, PreRelease: featuregate.Alpha}, EndpointSliceNodeName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, //remove in 1.25 WindowsEndpointSliceProxying: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25
promote EndpointSliceTerminatingCondition to Beta
kubernetes_kubernetes
train
go
634362c2b290a174019bebc35900cd420831022c
diff --git a/lib/moodle2cc/canvas_cc/discussion_writer.rb b/lib/moodle2cc/canvas_cc/discussion_writer.rb index <HASH>..<HASH> 100644 --- a/lib/moodle2cc/canvas_cc/discussion_writer.rb +++ b/lib/moodle2cc/canvas_cc/discussion_writer.rb @@ -43,6 +43,7 @@ module Moodle2CC::CanvasCC xml.type 'topic' xml.discussion_type discussion.discussion_type xml.require_initial_post discussion.require_initial_post + xml.workflow_state discussion.workflow_state } end.to_xml File.open(File.join(@work_dir, meta_resource.href), 'w') { |f| f.write(xml) }
moodle2: export topic workflow state
instructure_moodle2cc
train
rb
403e6b74bfe08cb37ea2500d7b4b90245eb73ca3
diff --git a/lib/mementus/integer_id.rb b/lib/mementus/integer_id.rb index <HASH>..<HASH> 100644 --- a/lib/mementus/integer_id.rb +++ b/lib/mementus/integer_id.rb @@ -2,15 +2,6 @@ require 'thread' module Mementus class IntegerId - def self.start_from(start_value) - @generator ||= self.new(start_value) - end - - def self.next_id - @generator ||= self.new - @generator.next_id - end - def initialize(start_value=1) @current_value = start_value @mutex = Mutex.new diff --git a/spec/integer_id_spec.rb b/spec/integer_id_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integer_id_spec.rb +++ b/spec/integer_id_spec.rb @@ -14,10 +14,4 @@ describe Mementus::IntegerId do expect(generator.next_id).to eq(101) expect(generator.next_id).to eq(102) end - - it 'allocates from a global generator' do - expect(Mementus::IntegerId.next_id).to eq(1) - expect(Mementus::IntegerId.next_id).to eq(2) - expect(Mementus::IntegerId.next_id).to eq(3) - end end
Remove lazy initialization causing shared mutable state
maetl_mementus
train
rb,rb
1ae4378fbcd66efe1d086409e165ecc45c4a96bf
diff --git a/src/Themosis/Route/Router.php b/src/Themosis/Route/Router.php index <HASH>..<HASH> 100644 --- a/src/Themosis/Route/Router.php +++ b/src/Themosis/Route/Router.php @@ -75,7 +75,7 @@ class Router { */ public function post($condition, $action) { - return $this->addRoute('POST', $condition, $action); + return $this->addRoute(['POST'], $condition, $action); } /** @@ -101,6 +101,7 @@ class Router { */ public function match($methods, $condition, $action) { + $methods = (array) $methods; return $this->addRoute($methods, $condition, $action); } @@ -114,6 +115,11 @@ class Router { */ protected function addRoute($methods, $condition, $action) { + $methods = array_map(function($method) + { + return strtoupper($method); + }, $methods); + return $this->routes->add($this->createRoute($methods, $condition, $action)); }
Fix #<I>. Route match methods can be defined in lowercase.
themosis_framework
train
php
e6a758289c8167396f28acc138cdd41547fbe798
diff --git a/src/Templates/BasePackageTemplate.php b/src/Templates/BasePackageTemplate.php index <HASH>..<HASH> 100644 --- a/src/Templates/BasePackageTemplate.php +++ b/src/Templates/BasePackageTemplate.php @@ -5,4 +5,55 @@ namespace NewUp\Templates; abstract class BasePackageTemplate { + /** + * The paths that NewUp should ignore. + * + * @var array + */ + protected $ignoredPaths = []; + + /** + * THe paths that NewUp should automatically remove. + * + * @var array + */ + protected $pathsToRemove = []; + + /** + * A list of paths that NewUp should expand and process. + * + * @var array + */ + protected $pathsToProcess = []; + + /** + * Returns the paths that NewUp should ignore. + * + * @return array + */ + public function getIgnoredPaths() + { + return $this->ignoredPaths; + } + + /** + * Returns the paths that NewUp should remove. + * + * @return array + */ + public function getPathsToRemove() + { + return $this->ignoredPaths; + } + + /** + * Returns the paths that NewUp should process. + * + * @return array + */ + public function getPathsToProcess() + { + return $this->pathsToProcess; + } + } \ No newline at end of file
Added members and getters These will be used by the engine to get the ignore paths, remove paths and processing paths. This replaces all the need for the various YAML and JSON files. Very nice!
newup_core
train
php
22ee8bba2f7c081d5a9e488233584f69d1af0bd6
diff --git a/test/helpers/kubectl.go b/test/helpers/kubectl.go index <HASH>..<HASH> 100644 --- a/test/helpers/kubectl.go +++ b/test/helpers/kubectl.go @@ -2417,6 +2417,11 @@ func (kub *Kubectl) ciliumControllersPreFlightCheck() error { } func (kub *Kubectl) ciliumHealthPreFlightCheck() error { + if IsIntegration(CIIntegrationEKS) { + ginkgoext.By("Skipping cilium-health --probe in EKS") + return nil + } + ginkgoext.By("Performing Cilium health check") var nodesFilter = `{.nodes[*].name}` var statusFilter = `{range .nodes[*]}{.name}{"="}{.host.primary-address.http.status}{"\n"}{end}`
CI: On EKS, skip cilium-health --probe endpoint-endpoint checks fail, and the healthcheck --probe will do that.
cilium_cilium
train
go
4fd35b8c340b01ffbdb6921902d3b57fecad79e7
diff --git a/tornado/test/escape_test.py b/tornado/test/escape_test.py index <HASH>..<HASH> 100644 --- a/tornado/test/escape_test.py +++ b/tornado/test/escape_test.py @@ -121,6 +121,10 @@ linkify_tests = [ ("www.external-link.com", {"extra_params": 'rel="nofollow" class="external"'}, u'<a href="http://www.external-link.com" rel="nofollow" class="external">www.external-link.com</a>'), + + ("www.external-link.com and www.internal-link.com/blogs extra", + {"extra_params": lambda(href):'class="internal"' if href.startswith("http://www.internal-link.com") else 'rel="nofollow" class="external"'}, + u'<a href="http://www.external-link.com" rel="nofollow" class="external">www.external-link.com</a> and <a href="http://www.internal-link.com/blogs" class="internal">www.internal-link.com/blogs</a> extra'), ]
Added a test case for extra_params as a callable
tornadoweb_tornado
train
py
70f9ce6f77be1495dd4d8d43eff95cc6046db4df
diff --git a/src/com/google/javascript/jscomp/NodeTraversal.java b/src/com/google/javascript/jscomp/NodeTraversal.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/NodeTraversal.java +++ b/src/com/google/javascript/jscomp/NodeTraversal.java @@ -687,6 +687,10 @@ public class NodeTraversal { t.traverseScopeRoot(scopeNode); } + /** + * @deprecated Use the ES6SyntacticScopeCreator instead. + */ + @Deprecated public static void traverseTyped(AbstractCompiler compiler, Node root, Callback cb) { NodeTraversal t = new NodeTraversal(compiler, cb, SyntacticScopeCreator.makeTyped(compiler)); t.traverse(root); @@ -698,6 +702,10 @@ public class NodeTraversal { t.traverseRoots(externs, root); } + /** + * @deprecated Use the ES6SyntacticScopeCreator instead. + */ + @Deprecated public static void traverseRootsTyped( AbstractCompiler compiler, Callback cb, Node externs, Node root) { NodeTraversal t = new NodeTraversal(compiler, cb, SyntacticScopeCreator.makeTyped(compiler));
Deprecate some NodeTraversal methods that are using the old scope creator. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
15d297bb5d0df7e39c177e1ec091c4b4ab4cc626
diff --git a/lib/steep/names.rb b/lib/steep/names.rb index <HASH>..<HASH> 100644 --- a/lib/steep/names.rb +++ b/lib/steep/names.rb @@ -24,7 +24,7 @@ module Steep end def hash - self.class.hash ^ name.hash ^ @absolute.hash + self.class.hash ^ name.hash ^ namespace.hash end alias eql? ==
Fix Steep::Names::Base#hash compute the hash from the same values as the values used for # ==
soutaro_steep
train
rb
a9331e21e72fba32e379bba99777b443f37e770d
diff --git a/mqtt/packet/publish_test.go b/mqtt/packet/publish_test.go index <HASH>..<HASH> 100644 --- a/mqtt/packet/publish_test.go +++ b/mqtt/packet/publish_test.go @@ -66,3 +66,13 @@ func TestNewPUBLISH_optsNil(t *testing.T) { nilErrorExpected(t, err) } } + +func TestNewPUBLISH_validateErr(t *testing.T) { + _, err := NewPUBLISH(&PUBLISHOptions{ + QoS: 0x03, + }) + + if err != ErrInvalidQoS { + invalidError(t, err, ErrInvalidQoS) + } +}
Update mqtt/packet/publish_test.go
yosssi_gmq
train
go
2cdc4f83a00ec71259a9a5c2781c72a1c97c6f86
diff --git a/resources/js/zaa.js b/resources/js/zaa.js index <HASH>..<HASH> 100644 --- a/resources/js/zaa.js +++ b/resources/js/zaa.js @@ -195,10 +195,14 @@ var zaa = angular.module("zaa", ["ui.router", "ngResource", "ngDragDrop", "angul service.toggleSelection = function(lang) { var exists = service.selection.indexOf(lang.short_code); + if (exists == -1) { service.selection.push(lang.short_code); } else { - service.selection.splice(exists, 1); + /* #531: unable to deselect language, as at least 1 langauge must be activated. */ + if (service.selection.length > 1) { + service.selection.splice(exists, 1); + } } };
Unable to deselect language, as at least 1 langauge must be active closes #<I>
luyadev_luya-module-admin
train
js
01adbde0ee14d2c3da355e33f845bd3bc28aefcf
diff --git a/elastic-harvester.js b/elastic-harvester.js index <HASH>..<HASH> 100644 --- a/elastic-harvester.js +++ b/elastic-harvester.js @@ -27,6 +27,7 @@ var defaultOptions = { } }; function ElasticHarvest(harvest_app,es_url,index,type,options) { + console.warn('[Elastic-Harvest] delete functionality does not work with ElasticSearch 2.x or greater.'); var _this= this; if(harvest_app){ this.collectionLookup=getCollectionLookup(harvest_app,type); diff --git a/test/deletes.spec.js b/test/deletes.spec.js index <HASH>..<HASH> 100644 --- a/test/deletes.spec.js +++ b/test/deletes.spec.js @@ -48,7 +48,8 @@ function reviveDilbert() { }) } -describe("deletes", function () { +// These tests no longer work when custom routing is enabled and ElasticSearch is version 2.x or greater +describe.skip("deletes", function () { before(function () { config = this.config;
waring about deletes not working on ES 2.x or greater
agco_elastic-harvesterjs
train
js,js
c63f36986656d7c98fdd807653ed5eb1ac8081c2
diff --git a/autotest/pst_tests.py b/autotest/pst_tests.py index <HASH>..<HASH> 100644 --- a/autotest/pst_tests.py +++ b/autotest/pst_tests.py @@ -990,7 +990,7 @@ def pst_from_flopy_geo_draw_test(): spatial_list_props=spat_list_props) - num_reals = 1000 + num_reals = 100000 pe1 = ph.draw(num_reals=num_reals, sigma_range=6) pyemu.Ensemble.reseed() pe2 = pyemu.ParameterEnsemble.from_gaussian_draw(ph.pst, ph.build_prior(sigma_range=6), num_reals=num_reals) @@ -1248,7 +1248,7 @@ if __name__ == "__main__": #new_format_test() #lt_gt_constraint_names_test() #csv_to_ins_test() - #pst_from_flopy_geo_draw_test() + pst_from_flopy_geo_draw_test() #try_process_ins_test() # write_tables_test() # res_stats_test() @@ -1258,7 +1258,7 @@ if __name__ == "__main__": # setattr_test() # run_array_pars() #from_flopy_zone_pars() - from_flopy_pp_test() + #from_flopy_pp_test() #from_flopy() # add_obs_test() #from_flopy_kl_test()
more hacking in pp setup to force sorted ordered instead of hash order
jtwhite79_pyemu
train
py
05a8fa4c5dc99e4a268a2e17c7d76fa17fd03f66
diff --git a/rest-dashboard.go b/rest-dashboard.go index <HASH>..<HASH> 100644 --- a/rest-dashboard.go +++ b/rest-dashboard.go @@ -158,13 +158,19 @@ func (r *Client) GetRawDashboardBySlug(ctx context.Context, slug string) ([]byte // FoundBoard keeps result of search with metadata of a dashboard. type FoundBoard struct { - ID uint `json:"id"` - UID string `json:"uid"` - Title string `json:"title"` - URI string `json:"uri"` - Type string `json:"type"` - Tags []string `json:"tags"` - IsStarred bool `json:"isStarred"` + ID uint `json:"id"` + UID string `json:"uid"` + Title string `json:"title"` + URI string `json:"uri"` + URL string `json:"url"` + Slug string `json:"slug"` + Type string `json:"type"` + Tags []string `json:"tags"` + IsStarred bool `json:"isStarred"` + FolderID int `json:"folderId"` + FolderUID string `json:"folderUid"` + FolderTitle string `json:"folderTitle"` + FolderURL string `json:"folderUrl"` } // SearchDashboards search dashboards by substring of their title. It allows restrict the result set with
Add folder meta data to FoundResult (#<I>)
grafana-tools_sdk
train
go
da0defa87a54edd1dd513113f850b1adf5419ac1
diff --git a/spec/ext/mongo_mapper_spec.rb b/spec/ext/mongo_mapper_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ext/mongo_mapper_spec.rb +++ b/spec/ext/mongo_mapper_spec.rb @@ -5,10 +5,6 @@ begin require "awesome_print/ext/mongo_mapper" describe "AwesomePrint/MongoMapper" do - before do - stub_dotfile! - end - before :all do class MongoUser include MongoMapper::Document @@ -18,7 +14,13 @@ begin end end + after :all do + Object.instance_eval{ remove_const :MongoUser } + Object.instance_eval{ remove_const :Chamelion } + end + before do + stub_dotfile! @ap = AwesomePrint::Inspector.new(:plain => true, :sort_keys => true) end diff --git a/spec/ext/mongoid_spec.rb b/spec/ext/mongoid_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ext/mongoid_spec.rb +++ b/spec/ext/mongoid_spec.rb @@ -14,7 +14,13 @@ begin end end + after :all do + Object.instance_eval{ remove_const :MongoUser } + Object.instance_eval{ remove_const :Chamelion } + end + before do + stub_dotfile! @ap = AwesomePrint::Inspector.new :plain => true, :sort_keys => true end
Resolved Mongoid/MongoMapper specs dependency
awesome-print_awesome_print
train
rb,rb
cc2f5bc16584af69a15a9ffaaa59d9b12ccfd1f7
diff --git a/env.js b/env.js index <HASH>..<HASH> 100755 --- a/env.js +++ b/env.js @@ -90,7 +90,7 @@ Promise.resolve() const peerDeps = adapterJson.peerDependencies; const installs = Object.keys(peerDeps) .filter(key => !key.startsWith('enzyme')) - .map(key => `${key}@${peerDeps[key]}`); + .map(key => `${key}@${key.startsWith('react') ? version : peerDeps[key]}`); // eslint-disable-next-line no-param-reassign testJson.dependencies[adapterName] = adapterJson.version;
[Tests] be sure to install the proper version of react
airbnb_enzyme
train
js
bbf38cca8ae0633ebb6a15f06766d5dbd566c3cb
diff --git a/godet.go b/godet.go index <HASH>..<HASH> 100644 --- a/godet.go +++ b/godet.go @@ -391,11 +391,12 @@ func (remote *RemoteDebugger) CloseTab(tab *Tab) error { // NewTab creates a new tab. func (remote *RemoteDebugger) NewTab(url string) (*Tab, error) { - params := Params{} + path := "/json/new" if url != "" { - params["url"] = url + path += "?" + url } - resp, err := remote.http.Get("/json/new", params, nil) + + resp, err := remote.http.Do(remote.http.Request("GET", path, nil, nil)) if err != nil { return nil, err }
Fix NewTab, that wasn't really opening a new tab (apparently the request is /json/new?requesturl instead of /json/new?url=requesturl). Note that I had to "unroll" HttpClient.Get because of a bug (or feature) in net/url when encoding a query parameter that is not name=value.
raff_godet
train
go
25a7cd79d6065d4e85e6b4df69eec63e28d570ec
diff --git a/test-support/helpers/ember-power-select.js b/test-support/helpers/ember-power-select.js index <HASH>..<HASH> 100644 --- a/test-support/helpers/ember-power-select.js +++ b/test-support/helpers/ember-power-select.js @@ -13,7 +13,17 @@ function typeText(selector, text) { } function fireNativeMouseEvent(eventType, selectorOrDomElement, options = {}) { - let event = new window.Event(eventType, { bubbles: true, cancelable: true, view: window }); + let event; + try { + event = new window.Event(eventType, { bubbles: true, cancelable: true, view: window }); + } catch (e) { + // fix IE11: "Object doesn't support this action" + event = document.createEvent('Event'); + let bubbles = true; + let cancelable = true; + event.initEvent(eventType, bubbles, cancelable); + } + Object.keys(options).forEach((key) => event[key] = options[key]); let target; if (typeof selectorOrDomElement === 'string') {
Fix error constructing Event in Internet Explorer <I> Tests which use the `clickTrigger` helper fail in IE<I>.
cibernox_ember-power-select
train
js
c9346f215ef3fb63a975d0a8e2e81653ee0b4987
diff --git a/thinc/layers/tensorflowwrapper.py b/thinc/layers/tensorflowwrapper.py index <HASH>..<HASH> 100644 --- a/thinc/layers/tensorflowwrapper.py +++ b/thinc/layers/tensorflowwrapper.py @@ -15,9 +15,7 @@ InT = TypeVar("InT") OutT = TypeVar("OutT") -def TensorFlowWrapper( - tensorflow_model: tf.keras.models.Model, build_model: bool = True -) -> Model: +def TensorFlowWrapper(tensorflow_model, build_model: bool = True) -> Model: """Wrap a TensorFlow model, so that it has the same API as Thinc models. To optimize the model, you'll need to create a TensorFlow optimizer and call optimizer.apply_gradients after each batch.
remove tensorflow type from top-level scope - if TF isn't installed it's not present. The type isn't that important, there's a runtime assertion inside the fn
explosion_thinc
train
py
b6bfb95f2ccd9767198184be2b24e2a8476ff777
diff --git a/spec/suite/rom/gateway_spec.rb b/spec/suite/rom/gateway_spec.rb index <HASH>..<HASH> 100644 --- a/spec/suite/rom/gateway_spec.rb +++ b/spec/suite/rom/gateway_spec.rb @@ -134,5 +134,5 @@ RSpec.describe ROM::Gateway do ROM::MissingAdapterIdentifierError, /Test::CustomGateway/ ) end - end # describe #adapter + end end
[rubocop] address Style/CommentedKeyword
rom-rb_rom
train
rb
c69a1362312ffd9de45f8627ae6a76f9a56da5c3
diff --git a/src/CollectionDataTable.php b/src/CollectionDataTable.php index <HASH>..<HASH> 100644 --- a/src/CollectionDataTable.php +++ b/src/CollectionDataTable.php @@ -255,7 +255,7 @@ class CollectionDataTable extends DataTableAbstract */ protected function searchPanesSearch() { - throw new \Exception('Search panes is not yet supported on collection'); + // TODO: Add support for search pane. } /**
Do not throw exception. Add TODO.
yajra_laravel-datatables
train
php
63e1f7c5e7575e304c3a03bee59fe82d6532c16d
diff --git a/lib/gcli/ui/terminal.js b/lib/gcli/ui/terminal.js index <HASH>..<HASH> 100644 --- a/lib/gcli/ui/terminal.js +++ b/lib/gcli/ui/terminal.js @@ -459,10 +459,21 @@ Terminal.prototype.handleKeyUp = function(ev) { } if (this.focusManager && ev.keyCode === KeyEvent.DOM_VK_ESCAPE) { - this.focusManager.removeHelp(); + if (this.focusManager.isTooltipVisible || + this.focusManager.isOutputVisible) { + this.focusManager.removeHelp(); + } + else if (this.inputElement.value === '') { + return this.popLanguage(); + } return RESOLVED; } + if (ev.keyCode === KeyEvent.DOM_VK_BACK_SPACE && + this.inputElement.value === '') { + return this.popLanguage(); + } + if (ev.keyCode === KeyEvent.DOM_VK_UP) { if (this.isMenuShowing) { return this.incrementChoice();
jsterm-<I>: Enable backspace to return to parent language Now pressing ':' takes you into command mode and pressing backspace takes you back again, similarly, pressing escape when there is no help to dismiss.
joewalker_gcli
train
js
d64bac4cdf158acf545629c8343fb87ac4f29feb
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py index <HASH>..<HASH> 100644 --- a/pandas/tests/test_indexing.py +++ b/pandas/tests/test_indexing.py @@ -1532,7 +1532,7 @@ class TestIndexing(unittest.TestCase): # related 236 # scalar/slicing of a float index - s = Series(np.arange(5), index=np.arange(5) * 2.5) + s = Series(np.arange(5), index=np.arange(5) * 2.5, dtype=np.int64) # label based slicing result1 = s[1.0:3.0]
TST: fix indexing test for windows failure
pandas-dev_pandas
train
py
b1c80207ebe985607770b851a01c93b698b0e3ec
diff --git a/billboard-top-100.js b/billboard-top-100.js index <HASH>..<HASH> 100644 --- a/billboard-top-100.js +++ b/billboard-top-100.js @@ -111,6 +111,9 @@ function getTitleFromChartItem(chartItem) { var title; try { title = chartItem.children[1].children[5].children[1].children[1].children[1].children[0].data.replace(/\n/g, ''); + if (title=='') { + title = chartItem.children[1].children[5].children[1].children[1].children[1].children[0].next.children[0].data.replace(/\n/g, ''); + } } catch (e) { title = ''; }
getting artist-<I> does not return title
darthbatman_billboard-top-100
train
js
d4af4c7c41de4e126ceeb36176295d82667dd067
diff --git a/lib/guard/notifiers/notifysend.rb b/lib/guard/notifiers/notifysend.rb index <HASH>..<HASH> 100644 --- a/lib/guard/notifiers/notifysend.rb +++ b/lib/guard/notifiers/notifysend.rb @@ -69,7 +69,7 @@ module Guard def notify(message, opts = {}) super - command = [title, message] + command = [opts[:title], message] opts = DEFAULTS.merge( i: opts.delete(:image), u: _notifysend_urgency(opts.delete(:type)) diff --git a/spec/lib/guard/notifiers/notifysend_spec.rb b/spec/lib/guard/notifiers/notifysend_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/guard/notifiers/notifysend_spec.rb +++ b/spec/lib/guard/notifiers/notifysend_spec.rb @@ -60,6 +60,15 @@ describe Guard::Notifier::NotifySend do notifier.notify('Welcome to Guard', image: '/tmp/welcome.png') end + + it 'uses the title provided in the options' do + notifier.should_receive(:system).with do |command, *arguments| + expect(command).to eql 'notify-send' + expect(arguments).to include 'Welcome to Guard' + expect(arguments).to include 'test title' + end + notifier.notify('Welcome to Guard', title: 'test title') + end end context 'without additional options' do
Properly sending titles through notify-send
guard_guard
train
rb,rb
f27b2c4e6d1441148cb33b6a2dba85df4c1e1268
diff --git a/lib/locallib.php b/lib/locallib.php index <HASH>..<HASH> 100644 --- a/lib/locallib.php +++ b/lib/locallib.php @@ -101,7 +101,7 @@ function upgrade_local_db($continueto) { $db->debug=false; if (set_config('local_version', $local_version)) { notify(get_string('databasesuccess'), 'notifysuccess'); - notify(get_string('databaseupgradelocal', '', $local_version)); + notify(get_string('databaseupgradelocal', '', $local_version), 'notifysuccess'); print_continue($continueto); print_footer('none'); exit;
Prevent unnecessary scroll to warning message during local version installation/upgrade due to missing notification type on success
moodle_moodle
train
php
2694de7c2d2381f18db5766b63b00fb704ee4955
diff --git a/core-bundle/src/Resources/contao/widgets/ChmodTable.php b/core-bundle/src/Resources/contao/widgets/ChmodTable.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/widgets/ChmodTable.php +++ b/core-bundle/src/Resources/contao/widgets/ChmodTable.php @@ -65,7 +65,7 @@ class ChmodTable extends \Widget { $return .= ' <tr> - <th scope="row" class="th">'.$GLOBALS['TL_LANG']['CHMOD'][$v].'</th>'; + <th scope="row">'.$GLOBALS['TL_LANG']['CHMOD'][$v].'</th>'; // Add checkboxes for ($j=1; $j<=6; $j++)
[Core] Also remove the obsolete class and format definition (see the previous commit)
contao_contao
train
php
684fd99e7a8a1f2b9ac0e3eae23c407508ee882c
diff --git a/matplotlib2tikz/__init__.py b/matplotlib2tikz/__init__.py index <HASH>..<HASH> 100644 --- a/matplotlib2tikz/__init__.py +++ b/matplotlib2tikz/__init__.py @@ -17,6 +17,10 @@ from matplotlib2tikz.__about__ import ( from matplotlib2tikz.save import get_tikz_code, save -import pipdated -if pipdated.needs_checking(__name__): - print(pipdated.check(__name__, __version__)) +try: + import pipdate +except ImportError: + pass +else: + if pipdate.needs_checking(__name__): + print(pipdate.check(__name__, __version__)) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( 'matplotlib >=1.4.0', 'numpy', 'Pillow >= 3.0.0', - 'pipdated', + 'pipdate', 'six', ], description='convert matplotlib figures into TikZ/PGFPlots',
don't strictly require pipdate
nschloe_matplotlib2tikz
train
py,py
ac467c8d53de0c4dd94a2526d9e2bd885be2b29c
diff --git a/lib/archivist/base/db.rb b/lib/archivist/base/db.rb index <HASH>..<HASH> 100644 --- a/lib/archivist/base/db.rb +++ b/lib/archivist/base/db.rb @@ -23,7 +23,7 @@ module Archivist def create_archive_table if table_exists? && !archive_table_exists? - cols = self.content_columns + cols = self.columns.reject { |column| column.name == primary_key } connection.create_table("archived_#{table_name}") cols.each do |c| connection.add_column("archived_#{table_name}",c.name,c.type)
take all columns not just content columns. Will need to deal with how to maintain referential integrity. But do not bring over the primary key column... perhaps we should
tpickett66_archivist
train
rb
f543a5749c63aee71d691a306e14471400e6ded0
diff --git a/python/setup.py b/python/setup.py index <HASH>..<HASH> 100755 --- a/python/setup.py +++ b/python/setup.py @@ -108,7 +108,7 @@ if platform.system() == 'Darwin': setup( name='neuroglancer', - version='1.1.2', + version='1.1.3', description='Python data backend for neuroglancer, a WebGL-based viewer for volumetric data', author='Jeremy Maitin-Shepard, Jan Funke', author_email='[email protected], [email protected]',
chore(python): bump package version to <I>
google_neuroglancer
train
py
408600c728f31f27fc333b1ef7d9057c6618dac5
diff --git a/src/mobilebone.js b/src/mobilebone.js index <HASH>..<HASH> 100644 --- a/src/mobilebone.js +++ b/src/mobilebone.js @@ -97,11 +97,10 @@ Mobilebone.pushStateEnabled = true; if (// When running inside a FF iframe, calling replaceState causes an error. So set 'pushStateEnabled = false' - !( window.navigator.userAgent.indexOf( "Firefox" ) >= 0 && window.top !== window ) && - ( window.navigator.userAgent.search(/CriOS/) === -1 ) + (window.navigator.userAgent.indexOf( "Firefox" ) >= 0 && window.top !== window) ) { - Mobilebone.pushStateEnabled = false; - } + Mobilebone.pushStateEnabled = false; + } /**
Only FF in iframe Only FF in iframe
zhangxinxu_mobilebone
train
js
09c26ce7e4c2e9766cf5c8dd82f0fc5c294ea888
diff --git a/meyda.js b/meyda.js index <HASH>..<HASH> 100644 --- a/meyda.js +++ b/meyda.js @@ -81,10 +81,11 @@ var Meyda = function(audioContext,source,bufferSize){ numerator += Math.log(powspec[i]); denominator += powspec[i]; } + console.log("spec", powspec); return Math.exp((1/powspec.length)*numerator)/((1/powspec.length)*denominator); }, "amplitudeSpectrum": function(bufferSize, m, spectrum){ - var ampRatioSpectrum = new Float32Array(bufferSize); + var ampRatioSpectrum = new Float32Array(spectrum.length); for (var i = 0; i < spectrum.length; i++) { ampRatioSpectrum[i] = Math.pow(10,spectrum[i]/20); @@ -101,7 +102,7 @@ var Meyda = function(audioContext,source,bufferSize){ return zcr; }, "powerSpectrum": function(bufferSize, m, spectrum){ - var powerRatioSpectrum = new Float32Array(bufferSize); + var powerRatioSpectrum = new Float32Array(spectrum.length); for (var i = 0; i < spectrum.length; i++) { powerRatioSpectrum[i] = Math.pow(10,spectrum[i]/10);
changed buffer size to spectrum size Former-commit-id: bb1f<I>a7a<I>cc<I>babf<I>fa<I>c<I>f4cf7c
meyda_meyda
train
js
8cdbe0e3e2b14749ab3323fc06f87ec07f69b82a
diff --git a/lib/rules.js b/lib/rules.js index <HASH>..<HASH> 100644 --- a/lib/rules.js +++ b/lib/rules.js @@ -28,6 +28,19 @@ var Rules = { }, message: "[NAME] is required." }, + requiredAllowEmptyString: { + value: "boolean", + validate: function(b) { + return function(v) { + var isNull = (v === undefined || v === null); + return !(b && isNull); + }; + }, + invalidData: function(b, base) { + return null; + }, + message: "[NAME] is required." + }, min: { value: "number", validate: function(n) {
Add requiredAllowEmptyString rule
shunjikonishi_api-first-spec
train
js
9a3d42022f3b3ca70cdf9a231120faa02e427a55
diff --git a/addon/models/learner-group.js b/addon/models/learner-group.js index <HASH>..<HASH> 100644 --- a/addon/models/learner-group.js +++ b/addon/models/learner-group.js @@ -119,7 +119,7 @@ export default Model.extend({ allParentTitles: computed('isTopLevelGroup', 'parent.{title,allParentTitles}', async function(){ const titles = []; if(!this.get('isTopLevelGroup')){ - const parent = await this.get('patent'); + const parent = await this.get('parent'); const allParentTitles = await parent.get('allParentTitles'); if(!isEmpty(allParentTitles)){ titles.pushObjects(allParentTitles);
fixed regression: typo - it is parent, not patent.
ilios_common
train
js
f662b3f81815418b092c35b3501b5450b136fff1
diff --git a/config/environment.rb b/config/environment.rb index <HASH>..<HASH> 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -8,7 +8,7 @@ require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| - config.gem 'jakewendt-calnet_authenticated' + config.gem 'ccls-calnet_authenticated' config.gem 'jakewendt-html_test' config.gem 'jakewendt-rails_extension'
Changed from jakewendt to ccls calnet_authenticated.
jakewendt_simply_authorized
train
rb
c8c5bed2fb106736136b8e6e31beb5993c69942e
diff --git a/spec/attr_vault_spec.rb b/spec/attr_vault_spec.rb index <HASH>..<HASH> 100644 --- a/spec/attr_vault_spec.rb +++ b/spec/attr_vault_spec.rb @@ -442,7 +442,7 @@ describe "stress test" do Thread.new do s = item.create(secret: 'that captain keen level in DOOM II') 1000.times do - new_secret = SecureRandom.base64(36) + new_secret = [ nil, '', SecureRandom.base64(36) ].sample s.update(secret: new_secret) s.reload expect(s.secret).to eq new_secret
Stress-test nil and empty string code paths too
uhoh-itsmaciek_attr_vault
train
rb
1db030b06ddde919ec2ce28fdf7c19bbd7f39bcf
diff --git a/keyring/backends/OS_X.py b/keyring/backends/OS_X.py index <HASH>..<HASH> 100644 --- a/keyring/backends/OS_X.py +++ b/keyring/backends/OS_X.py @@ -57,7 +57,7 @@ class Keyring(KeyringBackend): # check return code if code != 0: raise set_error - except: + except Exception: raise set_error def _interactive_set(self, service, username, password):
Only trap exceptions and not BaseExceptions such as KeyboardInterrupt.
jaraco_keyring
train
py
f8362689c4d8c2c7b59bb059d415f85569b31e92
diff --git a/openid.php b/openid.php index <HASH>..<HASH> 100644 --- a/openid.php +++ b/openid.php @@ -78,7 +78,7 @@ class LightOpenID || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ) { - $this->trustRoot = 'https://' . $host; + $this->trustRoot = (strpos($host, '://') ? $host : 'https://' . $host); } $uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?'); $this->returnUrl = $this->trustRoot . $uri;
Fixed a bug in parsing (#<I>).
Mewp_lightopenid
train
php
b1663954fe935beb0244002625e05402f59bd20e
diff --git a/lib/get-files.js b/lib/get-files.js index <HASH>..<HASH> 100644 --- a/lib/get-files.js +++ b/lib/get-files.js @@ -306,8 +306,7 @@ async function explode(paths, { accepts, debug }) { return path; }; - const many = async all => Promise.all(all.map(async file => list(file))); - + const many = all => Promise.all(all.map(file => list(file))); return flatten(await many(paths)).filter(v => v !== null); }
Removed useless `async` decleration
zeit_now-cli
train
js
d58d2ff9b1a8e9a90f52d7a61288be19465deba4
diff --git a/lib/analyze/headless.js b/lib/analyze/headless.js index <HASH>..<HASH> 100644 --- a/lib/analyze/headless.js +++ b/lib/analyze/headless.js @@ -8,7 +8,7 @@ var path = require('path'), childProcess = require('child_process'), - phantomPath = require('phantomjs').path, + phantomPath = require('phantomjs-prebuilt').path, slimerPath = require('slimerjs').path, util = require('../util/util'), inspect = require('util').inspect, diff --git a/lib/analyze/yslow.js b/lib/analyze/yslow.js index <HASH>..<HASH> 100644 --- a/lib/analyze/yslow.js +++ b/lib/analyze/yslow.js @@ -8,7 +8,7 @@ var path = require('path'), childProcess = require('child_process'), - phantomPath = require('phantomjs').path, + phantomPath = require('phantomjs-prebuilt').path, slimerPath = require('slimerjs').path, util = require('../util/util'), inspect = require('util').inspect,
use phantomjs prebuilt
sitespeedio_sitespeed.io
train
js,js
a4833e7b35c7dcd1334aa4ddcb52ad2af9f061da
diff --git a/spec/spec.request.js b/spec/spec.request.js index <HASH>..<HASH> 100644 --- a/spec/spec.request.js +++ b/spec/spec.request.js @@ -303,6 +303,41 @@ describe 'Express' end end end + + describe '#notFound()' + describe 'when accepting "html"' + describe 'with "helpful 404" enabled' + it 'should render the not-found page' + enable('helpful 404') + get('/', function(){ this.notFound() }) + get('/').body.should.include '<em>404</em> Not Found' + get('/').status.should.eql 404 + end + end + end + + describe 'when not accepting "html"' + describe 'with "helpful 404" enabled' + it 'should render defaulat 404 status body' + var headers = { headers: { accept: 'text/plain' }} + enable('helpful 404') + get('/', function(){ this.notFound() }) + get('/', headers).body.should.eql 'Not Found' + get('/', headers).status.should.eql 404 + end + end + end + + describe 'when "helpful 404" is disabled' + it 'should render defaulat 404 status body' + var headers = { headers: { accept: 'text/plain' }} + enable('helpful 404') + get('/', function(){ this.notFound() }) + get('/', headers).body.should.eql 'Not Found' + get('/', headers).status.should.eql 404 + end + end + end end end \ No newline at end of file
Added specs for Request#notFound()
expressjs_express
train
js
c91ae374de90b38eb98ce75ca7f19706020c7937
diff --git a/test/spec/SpecRunnerUtils.js b/test/spec/SpecRunnerUtils.js index <HASH>..<HASH> 100644 --- a/test/spec/SpecRunnerUtils.js +++ b/test/spec/SpecRunnerUtils.js @@ -364,13 +364,15 @@ define(function (require, exports, module) { }; _testWindow.closeAllFiles = function closeAllFiles() { - var promise = _testWindow.executeCommand(_testWindow.brackets.test.Commands.FILE_CLOSE_ALL); - waitsForDone(promise, "Close all open files in working set"); - - var $dlg = _testWindow.$(".modal.instance"); - if ($dlg.length) { - clickDialogButton("dontsave"); - } + runs(function () { + var promise = _testWindow.executeCommand(_testWindow.brackets.test.Commands.FILE_CLOSE_ALL); + waitsForDone(promise, "Close all open files in working set"); + + var $dlg = _testWindow.$(".modal.instance"); + if ($dlg.length) { + clickDialogButton("dontsave"); + } + }); }; });
Use runs when closing all the files.
adobe_brackets
train
js
edb20d51465c15bea775b43adf46556cac386b68
diff --git a/Connectors/SqlServerConnector.php b/Connectors/SqlServerConnector.php index <HASH>..<HASH> 100755 --- a/Connectors/SqlServerConnector.php +++ b/Connectors/SqlServerConnector.php @@ -160,6 +160,10 @@ class SqlServerConnector extends Connector implements ConnectorInterface $arguments['LoginTimeout'] = $config['login_timeout']; } + if (isset($config['authentication'])) { + $arguments['Authentication'] = $config['authentication']; + } + return $this->buildConnectString('sqlsrv', $arguments); }
Added Authentication keyword for ODBC driver (#<I>)
illuminate_database
train
php
3195162d53314181e024757c562b3bab370c7aca
diff --git a/config/webpack.config.base.js b/config/webpack.config.base.js index <HASH>..<HASH> 100644 --- a/config/webpack.config.base.js +++ b/config/webpack.config.base.js @@ -54,7 +54,7 @@ module.exports = { ] }, plugins: [ - new webpack.ContextReplacementPlugin(/date-fns[/\\]locale$/, /en/), + new webpack.ContextReplacementPlugin(/date-fns[/\\]locale$/, /(en|es|fr)/), new webpack.DefinePlugin({ __VERSION__: JSON.stringify(pkg.version) })
feat(i<I>n): Include date-fns es and fr locale in build
cozy_cozy-bar
train
js
e5225702d7eba5994438115d5266913209eaa67e
diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index <HASH>..<HASH> 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -286,6 +286,14 @@ class SupportCollectionTest extends PHPUnit_Framework_TestCase { } + public function testRandomOnEmpty() + { + $data = new Collection(); + $random = $data->random(); + $this->assertNull($random); + } + + public function testTakeLast() { $data = new Collection(array('taylor', 'dayle', 'shawn'));
Add test to collection->random() when collection is empty
laravel_framework
train
php
62dafd77338b92f90c46bccca224f937f751cbb8
diff --git a/lib/dates-between.js b/lib/dates-between.js index <HASH>..<HASH> 100644 --- a/lib/dates-between.js +++ b/lib/dates-between.js @@ -1,5 +1,4 @@ /** - * Dates-between module * @module dates-between */ 'use strict'; @@ -30,7 +29,7 @@ module.exports = function *datesBetween(startDate, endDate) { * @access private * @param {Date} date * The date object to increment. - * @param {Number} amount + * @param {number} amount * The number of days to increment by. * @returns {Date} * Returns the incremented date.
chore: fix eslint issues
rowanmanning_dates-between
train
js
3a6fadd865dd5cadbf35ca727c85d54ba189022a
diff --git a/swf/src/main/java/com/venky/swf/integration/IntegrationAdaptor.java b/swf/src/main/java/com/venky/swf/integration/IntegrationAdaptor.java index <HASH>..<HASH> 100644 --- a/swf/src/main/java/com/venky/swf/integration/IntegrationAdaptor.java +++ b/swf/src/main/java/com/venky/swf/integration/IntegrationAdaptor.java @@ -75,7 +75,11 @@ public class IntegrationAdaptor<M extends Model,T> { public View createResponse(Path path, M m, List<String> includeFields) { FormatHelper<T> helper = FormatHelper.instance(getMimeType(),modelReflector.getModelClass().getSimpleName(),false); T element = helper.getRoot(); - writer.write(m, element , getFields(includeFields)); + T elementAttribute = helper.getElementAttribute(modelReflector.getModelClass().getSimpleName()); + if (elementAttribute == null) { + elementAttribute = element; + } + writer.write(m, elementAttribute , getFields(includeFields)); return new BytesView(path, element.toString().getBytes()); }
Generalized JSON/XML output in the same way
venkatramanm_swf-all
train
java
e1ca0e72e5fa90649d0c11acdc6a97a224fe22fb
diff --git a/openquake/engine/db/models.py b/openquake/engine/db/models.py index <HASH>..<HASH> 100644 --- a/openquake/engine/db/models.py +++ b/openquake/engine/db/models.py @@ -1627,6 +1627,15 @@ class HazardMap(djm.Model): class Meta: db_table = 'hzrdr\".\"hazard_map' + def __str__(self): + return ( + 'HazardMap(poe=%(poe)s, imt=%(imt)s, sa_period=%(sa_period)s, ' + 'statistics=%(statistics)s, quantile=%(quantile)s)' + ) % self.__dict__ + + def __repr__(self): + return self.__str__() + def parse_imt(imt): """
db/models: Implemented `__str__` and `__repr__` for HazardMap. This makes debugging, etc. nicer.
gem_oq-engine
train
py
b115999a7519b27f67fe960555fca87216b4c9d6
diff --git a/smtp_client.js b/smtp_client.js index <HASH>..<HASH> 100644 --- a/smtp_client.js +++ b/smtp_client.js @@ -311,6 +311,7 @@ exports.get_client_plugin = function (plugin, connection, config, callback) { }); smtp_client.on('helo', function () { + connection.logdebug(plugin, 'Sending mail to in smtp_client (' + connection.uuid + ' ' + connection.transaction + ' ' + smtp_client.listeners('helo').length + ')'); smtp_client.send_command('MAIL', 'FROM:' + connection.transaction.mail_from); });
Added logging line for debugging.
haraka_Haraka
train
js
070c1d74220d732713689f463969188e8e3afd6d
diff --git a/src/Graviton/CoreBundle/Service/CoreVersionUtils.php b/src/Graviton/CoreBundle/Service/CoreVersionUtils.php index <HASH>..<HASH> 100644 --- a/src/Graviton/CoreBundle/Service/CoreVersionUtils.php +++ b/src/Graviton/CoreBundle/Service/CoreVersionUtils.php @@ -105,7 +105,7 @@ class CoreVersionUtils $versions, array( 'id' => $content[0], - 'version' => $this->checkVersionNumber($content[1]) + 'version' => $content[1] ) ); } @@ -251,6 +251,9 @@ class CoreVersionUtils /** * Changing the incorrect SemVer string to a valid one * + * At the moment, we are getting the version of the root package ('self') using the + * 'composer show -s'-command. Unfortunately Composer is adding an unnecessary ending. + * * @param string $versionString SemVer version string * @return string */
removed semver check for installed packages
libgraviton_graviton
train
php
90905d16d38f1f8adbdc587663123a9c8a91d5ab
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -12,7 +12,6 @@ # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. class OrganizationsController < ApplicationController - navigation :organizations include AutoCompleteSearch respond_to :html, :js skip_before_filter :authorize
argh! found and removed explicit call to navigation in controller
Katello_katello
train
rb