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
0a64f997f2e9844a9bc3de632df7e538ed3d4f7b
diff --git a/src/Stack/RouterStack.php b/src/Stack/RouterStack.php index <HASH>..<HASH> 100644 --- a/src/Stack/RouterStack.php +++ b/src/Stack/RouterStack.php @@ -62,7 +62,7 @@ class RouterStack implements MiddlewareInterface $app->prepend($filter); } } - if($route->trailing()) { + if($route->matched()) { $request = $request->withPathToMatch($route->matched(), $route->trailing()); } $request = $request->withAttribute(App::ROUTE_NAMES, $this->router->getReverseRoute($request));
trailing sometimes returns empty string; use matched to check if route is matched.
TuumPHP_Web
train
php
e1665067ae440614bce20e0afc81b04e451dfea5
diff --git a/src/mina.js b/src/mina.js index <HASH>..<HASH> 100644 --- a/src/mina.js +++ b/src/mina.js @@ -338,6 +338,6 @@ var mina = (function (eve) { } return l; }; - + window.mina = mina; return mina; })(typeof eve == "undefined" ? function () {} : eve); \ No newline at end of file
fix issue in last checkin that broke mina
adobe-webplatform_Snap.svg
train
js
b3e2d942b736e85146711e1e8c5a389397c35b70
diff --git a/tests/TestCase/Shell/Task/ImportTaskTest.php b/tests/TestCase/Shell/Task/ImportTaskTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Shell/Task/ImportTaskTest.php +++ b/tests/TestCase/Shell/Task/ImportTaskTest.php @@ -58,7 +58,7 @@ class ImportTaskTest extends TestCase $this->assertSame(1, $query->count()); $entity = $query->firstOrFail(); - Assert::nullOrIsInstanceOf($entity, \Cake\Datasource\EntityInterface::class); + Assert::isInstanceOf($entity, \Cake\Datasource\EntityInterface::class); $group = $entity->toArray(); $this->assertSame([], array_diff_assoc($data, $group)); @@ -72,7 +72,7 @@ class ImportTaskTest extends TestCase $this->Task->main(); $entity = $this->Groups->find()->where(['name' => $data['name']])->firstOrFail(); - Assert::nullOrIsInstanceOf($entity, \Cake\Datasource\EntityInterface::class); + Assert::isInstanceOf($entity, \Cake\Datasource\EntityInterface::class); $updated = $entity->toArray(); $data['deny_edit'] ?
Use stricter assertion (task #<I>)
QoboLtd_cakephp-groups
train
php
a308044082ee4563b0c3bcecef15fea60c85ec6a
diff --git a/desktop/webpack.config.development.js b/desktop/webpack.config.development.js index <HASH>..<HASH> 100644 --- a/desktop/webpack.config.development.js +++ b/desktop/webpack.config.development.js @@ -72,6 +72,7 @@ if (USING_DLL) { config.plugins.push( new webpack.DllReferencePlugin({ context: './renderer', + // $FlowIssue manifest: require('./dll/vendor-manifest.json'), }) )
Declare webpack dll manifest's type to flow (#<I>)
keybase_client
train
js
a79476f99fe993ce5920f961215d4fedbd0393e0
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index <HASH>..<HASH> 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Code Quality', :quality => true do +describe 'Code Quality', :quality do unless RUBY_VERSION < '1.9' it 'has no style-guide violations' do 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 @@ -12,9 +12,10 @@ RSpec.configure do |config| config.color = true config.fail_fast = true unless ENV['CI'] config.formatter = 'documentation' + config.treat_symbols_as_metadata_keys_with_true_values = true config.include Helpers - # disables should syntax + # disables 'should' syntax config.expect_with :rspec do |c| c.syntax = :expect end
minor: tweaking rspec tag handling, using symbols as keys
mongodb_mongo-ruby-driver
train
rb,rb
1a631fd74019df83e515f368f47a96cd3b2c46c8
diff --git a/lib/taopaipai/io.rb b/lib/taopaipai/io.rb index <HASH>..<HASH> 100644 --- a/lib/taopaipai/io.rb +++ b/lib/taopaipai/io.rb @@ -25,8 +25,16 @@ module Taopaipai end private - def write_to_file(path, content) - File.open(relative(path), 'w'){|f| f.write(content) } + def write_to_file(path, content, last_attempt = false) + begin + File.open(relative(path), 'w'){|f| f.write(content) } + rescue => e + if last_attempt + write_to_file(path, content, true) + else + raise e + end + end end def relative(path)
IO now tries to write twice.
servebox_taopaipai
train
rb
311879ae04df7412b0da2a7075b73f530984e164
diff --git a/lib/shopify_api.rb b/lib/shopify_api.rb index <HASH>..<HASH> 100644 --- a/lib/shopify_api.rb +++ b/lib/shopify_api.rb @@ -190,7 +190,7 @@ module ShopifyAPI # the shop. class Shop < Base def self.current - find(:one, :from => "/admin/shop.xml") + find(:one, :from => "/admin/shop.#{format.extension}") end def metafields @@ -423,7 +423,7 @@ module ShopifyAPI if args[0].is_a?(Symbol) super else - find(:one, :from => "/admin/assets.xml", :params => {:asset => {:key => args[0]}}) + find(:one, :from => "/admin/assets.#{format.extension}", :params => {:asset => {:key => args[0]}}) end end
Don't hard code xml URLs The Shopify API supports JSON as well as XML, these two method calls were causing clients to receive XML responses, even when they had told ActiveResource to use JSON.
Shopify_shopify_api
train
rb
ececb27536426cac1d870fac26e0194b58f030f4
diff --git a/bees/bees.go b/bees/bees.go index <HASH>..<HASH> 100644 --- a/bees/bees.go +++ b/bees/bees.go @@ -22,6 +22,7 @@ package bees import ( + "fmt" "sync" "time" @@ -335,14 +336,14 @@ func (bee *Bee) Logln(args ...interface{}) { // Logf logs a formatted string func (bee *Bee) Logf(format string, args ...interface{}) { - log.Printf("[%s]: ", bee.Name()) - log.Printf(format, args...) + s := fmt.Sprintf(format, args...) + log.Printf("[%s]: %s", bee.Name(), s) } // LogErrorf logs a formatted error string func (bee *Bee) LogErrorf(format string, args ...interface{}) { - log.Printf("[%s]: ", bee.Name()) - log.Errorf(format, args...) + s := fmt.Sprintf(format, args...) + log.Errorf("[%s]: %s", bee.Name(), s) } // LogFatal logs a fatal error
Fixed Logf & LogErrorf methods printing multiple lines
muesli_beehive
train
go
e22955e795d9eaf556822b025aa33bbac7c979e5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -97,6 +97,9 @@ function main (processArgv, conf) { // Configure opts and run command (inside a domain to catch any error) commands.run(command, opts, conf, function (e) { console.error(e.message); + if (process.env.DEBUG) { + throw e; + } process.exit(1); }); } @@ -109,6 +112,9 @@ function safeMain (processArgv) { if (err) { console.error("Error found in your current environment:"); console.error(err.message); + if (process.env.DEBUG) { + throw err; + } process.exit(2); }
if env DEBUG is set, throw errors instead of just showing message
naholyr_github-todos
train
js
fe8e196b9b4767105e03025000523020c467cb1e
diff --git a/lib/data_mapper/relation/mapper.rb b/lib/data_mapper/relation/mapper.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/relation/mapper.rb +++ b/lib/data_mapper/relation/mapper.rb @@ -99,8 +99,9 @@ module DataMapper # # @api public def self.key(*names) + attribute_set = attributes names.each do |name| - attributes << attributes[name].clone(:key => true) + attribute_set << attribute_set[name].clone(:key => true) end self end @@ -316,8 +317,11 @@ module DataMapper # # @api public def order(*names) - order_attributes = names.map { |attribute| attributes.field_name(attribute) } - order_attributes.concat(attributes.fields).uniq! + attribute_set = attributes + order_attributes = names.map { |attribute| + attribute_set.field_name(attribute) + } + order_attributes.concat(attribute_set.fields).uniq! new(relation.order(*order_attributes)) end @@ -599,7 +603,8 @@ module DataMapper # # @api public def inspect - "#<#{self.class.name} @model=#{model.name} @relation_name=#{relation_name} @repository=#{self.class.repository}>" + klass = self.class + "#<#{klass.name} @model=#{model.name} @relation_name=#{relation_name} @repository=#{klass.repository}>" end private
Avoid duplicate method calls by using an lvar
rom-rb_rom
train
rb
ba893b9f1c1dcd5d5fcf7a921250e19cef222e27
diff --git a/src/main/java/org/primefaces/component/api/FilterableTable.java b/src/main/java/org/primefaces/component/api/FilterableTable.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/primefaces/component/api/FilterableTable.java +++ b/src/main/java/org/primefaces/component/api/FilterableTable.java @@ -165,10 +165,12 @@ public interface FilterableTable extends ColumnHolder { else { UIColumn column = filterMeta.getColumn(); UIComponent filterFacet = column.getFacet("filter"); - boolean hasCustomFilter = ComponentUtils.shouldRenderFacet(filterFacet); + boolean hasCustomFilter = filterFacet != null; if (column instanceof DynamicColumn) { if (hasCustomFilter) { ((DynamicColumn) column).applyModel(); + // UIColumn#rendered might change after restoring p:columns state at the right index + hasCustomFilter = ComponentUtils.shouldRenderFacet(filterFacet); } else { ((DynamicColumn) column).applyStatelessModel();
Fix #<I> - Datatable: filter facet does not work with p:columns
primefaces_primefaces
train
java
cdb6d2e901a011b8fa17a5400f300024f7f7ff30
diff --git a/serverless-plugin/index.js b/serverless-plugin/index.js index <HASH>..<HASH> 100644 --- a/serverless-plugin/index.js +++ b/serverless-plugin/index.js @@ -43,23 +43,29 @@ class ServerlessPlugin { {} ); - this.stackArgs = []; - if (process.platform !== 'linux') { - // Use Stack's Docker build - this.serverless.cli.log("Using Stack's Docker image."); - this.runStack(['docker', 'pull']); - this.stackArgs.push('--docker'); - } + this.docker = { + required: process.platform !== 'linux', + haveImage: false, + }; this.additionalFiles = []; } runStack(args, captureOutput) { + const dockerArgs = []; + if (this.docker.required) { + if (!this.docker.haveImage) { + this.serverless.cli.log("Using Stack's Docker image."); + spawnSync('stack', ['docker', 'pull'], NO_OUTPUT_CAPTURE); + this.docker.haveImage = true; + } + dockerArgs.push('--docker'); + } return spawnSync( 'stack', [ ...args, - ...this.stackArgs, + ...dockerArgs, ...this.custom.stackBuildArgs, ], captureOutput ? {} : NO_OUTPUT_CAPTURE
Do not pull Docker image unless needed
seek-oss_serverless-haskell
train
js
4890e86af636fe4fdbaab4de56fc91eb478e2e60
diff --git a/tests/Payum/Payex/Tests/Functional/Api/OrderApiTest.php b/tests/Payum/Payex/Tests/Functional/Api/OrderApiTest.php index <HASH>..<HASH> 100644 --- a/tests/Payum/Payex/Tests/Functional/Api/OrderApiTest.php +++ b/tests/Payum/Payex/Tests/Functional/Api/OrderApiTest.php @@ -13,10 +13,10 @@ class OrderApiTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - if (false == isset($GLOBALS['__PAYUM_PAYEX_ACCOUNT_NUMBER'])) { + if (empty($GLOBALS['__PAYUM_PAYEX_ACCOUNT_NUMBER'])) { throw new \PHPUnit_Framework_SkippedTestError('Please configure __PAYUM_PAYEX_ACCOUNT_NUMBER in your phpunit.xml'); } - if (false == isset($GLOBALS['__PAYUM_PAYEX_ENCRYPTION_KEY'])) { + if (empty($GLOBALS['__PAYUM_PAYEX_ENCRYPTION_KEY'])) { throw new \PHPUnit_Framework_SkippedTestError('Please configure __PAYUM_PAYEX_ENCRYPTION_KEY in your phpunit.xml'); } }
fix skipp functional tests on travis.
Payum_Payum
train
php
dc6679d636fb0404be5502b4ee6f22ae3eb1358f
diff --git a/src/Tag/METER.php b/src/Tag/METER.php index <HASH>..<HASH> 100644 --- a/src/Tag/METER.php +++ b/src/Tag/METER.php @@ -5,7 +5,7 @@ namespace Mpdf\Tag; use Mpdf\Mpdf; -class METER extends Tag +class METER extends InlineTag { public function open($attr, &$ahtml, &$ihtml) @@ -304,6 +304,7 @@ class METER extends Tag public function close(&$ahtml, &$ihtml) { + parent::close($ahtml, $ihtml); $this->mpdf->ignorefollowingspaces = false; $this->mpdf->inMeter = false; }
fix: make PROGRESS and METER inline tags again
mpdf_mpdf
train
php
e96bd75f84b783831868c7242bf110c13cceee5e
diff --git a/cmux.go b/cmux.go index <HASH>..<HASH> 100644 --- a/cmux.go +++ b/cmux.go @@ -115,7 +115,8 @@ type cMux struct { func matchersToMatchWriters(matchers []Matcher) []MatchWriter { mws := make([]MatchWriter, 0, len(matchers)) - for _, m := range matchers { + for _, _m := range matchers { + m := _m mws = append(mws, func(w io.Writer, r io.Reader) bool { return m(r) })
Fix bug matchers are ignored except last one
soheilhy_cmux
train
go
e51f01f4645c547bacc8a49b385d588452407da7
diff --git a/pyccc/docker_utils.py b/pyccc/docker_utils.py index <HASH>..<HASH> 100644 --- a/pyccc/docker_utils.py +++ b/pyccc/docker_utils.py @@ -132,7 +132,7 @@ def make_tar_stream(build_context, buffer): """ tf = tarfile.TarFile(fileobj=buffer, mode='w') for context_path, fileobj in build_context.items(): - if isinstance(fileobj, (files.LocalDirectoryReference, files.LocalFile)): + if getattr(fileobj, 'localpath', None) is not None: tf.add(fileobj.localpath, arcname=context_path) else: tar_add_bytes(tf, context_path, fileobj.read('rb'))
Duck-typed approach to checking for local instances of file references
Autodesk_pyccc
train
py
048b03917c84dfdca8b5aeea82c27f43b7990820
diff --git a/resources/lang/en-US/cachet.php b/resources/lang/en-US/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/en-US/cachet.php +++ b/resources/lang/en-US/cachet.php @@ -75,10 +75,11 @@ return [ // Subscriber 'subscriber' => [ - 'subscribe' => 'Subscribe to get the most recent updates', - 'unsubscribe' => 'Unsubscribe at :link', - 'button' => 'Subscribe', - 'manage' => [ + 'subscribe' => 'Subscribe to get the most recent updates', + 'unsubscribe' => 'Unsubscribe', + 'button' => 'Subscribe', + 'manage_subscription' => 'Manage subscription', + 'manage' => [ 'no_subscriptions' => 'You\'re currently subscribed to all updates.', 'my_subscriptions' => 'You\'re currently subscribed to the following updates.', 'manage_at_link' => 'Manage your subscriptions at :link',
New translations cachet.php (English)
CachetHQ_Cachet
train
php
ec53432baa971a1c7c8d48917d525f3519546ba7
diff --git a/components/Templates/includes/auto-template/Pods_Templates_Auto_Template_Settings.php b/components/Templates/includes/auto-template/Pods_Templates_Auto_Template_Settings.php index <HASH>..<HASH> 100644 --- a/components/Templates/includes/auto-template/Pods_Templates_Auto_Template_Settings.php +++ b/components/Templates/includes/auto-template/Pods_Templates_Auto_Template_Settings.php @@ -192,7 +192,7 @@ class Pods_Templates_Auto_Template_Settings { } - $options[ 'pods-pfat' ][ 'pfat_archive' ][ 'data' ] = array_combine( $this->get_template_titles(), $this->get_template_titles() ); + $options[ 'pods-pfat' ][ 'pfat_archive' ][ 'data' ] = array( null => __('No Archive view template', 'pods') ) + ( array_combine( $this->get_template_titles(), $this->get_template_titles() ) ); $options[ 'pods-pfat' ][ 'pfat_single' ][ 'data' ] = array_combine( $this->get_template_titles(), $this->get_template_titles() ); }
Added option to deselect auto template for archive views
pods-framework_pods
train
php
f56794926f072820e92420a2ebd06f3104f0b000
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,10 +32,10 @@ extras_require = { } # add packages with choices, using already installed ones if available -qt_option = 'PySide2' -if sys.version_info >= (3, 10, 0): - qt_option = 'PySide6' -for name in 'PySide2', 'PySide6', 'PyQt5': +qt_option = 'PySide6' +if sys.version_info < (3, 6, 0): + qt_option = 'PySide2' +for name in 'PySide6', 'PySide2', 'PyQt5': if importlib.util.find_spec(name) is not None: qt_option = None break diff --git a/src/photini/__init__.py b/src/photini/__init__.py index <HASH>..<HASH> 100644 --- a/src/photini/__init__.py +++ b/src/photini/__init__.py @@ -1,4 +1,4 @@ from __future__ import unicode_literals __version__ = '2021.12.0' -build = '1890 (b669767)' +build = '1891 (17a7ff7)'
Prefer PySide6 over PySide2 or PyQt5 when none of them is already installed.
jim-easterbrook_Photini
train
py,py
071ec1a6c89dd177755278e5317f0a81008e1b72
diff --git a/lib/pytaf/tafdecoder.py b/lib/pytaf/tafdecoder.py index <HASH>..<HASH> 100644 --- a/lib/pytaf/tafdecoder.py +++ b/lib/pytaf/tafdecoder.py @@ -268,7 +268,8 @@ class Decoder(object): "SG" : "snow grains", "IC" : "ice", "PL" : "ice pellets", - "GR" : "small snow/hail pellets", + "GR" : "hail", + "GS" : "small snow/hail pellets", "UP" : "unknown precipitation", "BR" : "mist", "FG" : "fog",
fixed dict_phenomenons which was missing "GS" ("small now/hail pellets") while GR (actually "hail") was incorrectly labeled "small now/hail pellets"
dmbaturin_pytaf
train
py
afca6c6cc5d01f330aec4283f0a999ca24b8e939
diff --git a/bfg9000/tools/cc/linker.py b/bfg9000/tools/cc/linker.py index <HASH>..<HASH> 100644 --- a/bfg9000/tools/cc/linker.py +++ b/bfg9000/tools/cc/linker.py @@ -156,10 +156,10 @@ class CcLinker(BuildCommand): changed = False for i in options: if isinstance(i, opts.lib): - lib = i.library - if isinstance(lib, Library) and lib.runtime_file: - local = self._local_rpath(lib, output)[0][0] - installed = file_install_path(lib, cross=self.env).parent() + if isinstance(i.library, Library) and i.library.runtime_file: + runtime = i.library.runtime_file + local = self._local_rpath(runtime, output)[0][0] + installed = file_install_path(runtime, self.env).parent() result.append(installed) if not isinstance(local, BasePath) or local != installed: changed = True
Be more precise about the installed rpaths Technically speaking, the rpath is based on the location of the *runtime* file associated with the library, not the library passed in as an argument. For example, with a versioned shared lib, the input file is libfoo.so, but the runtime file is libfoo.so<I>. We want the latter.
jimporter_bfg9000
train
py
aaea6907674d1b55907b5d41d3daa74540a2da5f
diff --git a/lib/AssetGraph.js b/lib/AssetGraph.js index <HASH>..<HASH> 100644 --- a/lib/AssetGraph.js +++ b/lib/AssetGraph.js @@ -288,8 +288,8 @@ AssetGraph.prototype = { if (this.getBaseAssetForRelation(affectedRelation) === asset) { if (affectedRelation.to.url) { affectedRelation._setRawUrlString(fileUtils.buildRelativeUrl(asset.url, affectedRelation.to.url)); + this.markAssetDirty(affectedRelation.from); } - this.markAssetDirty(asset); } }, this); this.findRelations({to: asset}).forEach(function (incomingRelation) { diff --git a/lib/relations/HTMLScript.js b/lib/relations/HTMLScript.js index <HASH>..<HASH> 100644 --- a/lib/relations/HTMLScript.js +++ b/lib/relations/HTMLScript.js @@ -12,7 +12,7 @@ util.inherits(HTMLScript, Base); _.extend(HTMLScript.prototype, { _getRawUrlString: function () { - return this.node.getAttribute('src', url) || undefined; + return this.node.getAttribute('src') || undefined; }, _setRawUrlString: function (url) {
AssetGraph.setAssetUrl: Marked the wrong asset dirty.
assetgraph_assetgraph
train
js,js
129b3bb7d3a1e0eadcbaa03d90eb4d79c08d2acd
diff --git a/libraries/joomla/database/database.php b/libraries/joomla/database/database.php index <HASH>..<HASH> 100644 --- a/libraries/joomla/database/database.php +++ b/libraries/joomla/database/database.php @@ -36,6 +36,24 @@ abstract class JDatabase } /** + * Get a list of available database connectors. The list will only be populated with connectors that both + * the class exists and the static test method returns true. This gives us the ability to have a multitude + * of connector classes that are self-aware as to whether or not they are able to be used on a given system. + * + * @return array An array of available database connectors. + * + * @since 11.1 + * @deprecated 13.1 + */ + public static function getConnectors() + { + // Deprecation warning. + JLog::add('JDatabase::getConnectors() is deprecated, use JDatabaseDriver::getConnectors() instead.', JLog::NOTICE, 'deprecated'); + + return JDatabaseDriver::getConnectors(); + } + + /** * Gets the error message from the database connection. * * @param boolean $escaped True to escape the message string for use in JavaScript.
Add JDatabase::getConnectors for B/C
joomla_joomla-framework
train
php
6f640e51c246270a99c20f378ebb69000b0954e8
diff --git a/javatools/__init__.py b/javatools/__init__.py index <HASH>..<HASH> 100644 --- a/javatools/__init__.py +++ b/javatools/__init__.py @@ -1699,7 +1699,7 @@ class JavaExceptionInfo(object): ct = self.get_catch_type() if ct: - return "Class " + ct + return "Class " + _pretty_class(ct) else: return "any"
make pretty_catch_type actually pretty
obriencj_python-javatools
train
py
3962d8e680c393eebc06afe0f44075e0c3509272
diff --git a/inginious/frontend/webapp/app.py b/inginious/frontend/webapp/app.py index <HASH>..<HASH> 100644 --- a/inginious/frontend/webapp/app.py +++ b/inginious/frontend/webapp/app.py @@ -14,7 +14,6 @@ import web from frontend.common.arch_helper import create_arch, start_asyncio_and_zmq from inginious.frontend.common.static_middleware import StaticMiddleware -from inginious.frontend.common.webpy_fake_mapping import WebPyCustomMapping from inginious.frontend.webapp.database_updater import update_database from inginious.frontend.common.plugin_manager import PluginManager from inginious.common.course_factory import create_factories
Forgot to remove a WebPyFakeMapping reference
UCL-INGI_INGInious
train
py
49bb7a3725bb20149adc2cc7dbb9d57d67e11cb8
diff --git a/lib/que/version.rb b/lib/que/version.rb index <HASH>..<HASH> 100644 --- a/lib/que/version.rb +++ b/lib/que/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Que - VERSION = '2.0.0.beta1' + VERSION = '2.0.0' def self.job_schema_version 2
Update version number to <I>
chanks_que
train
rb
5c3cc3355f97d67ecdcde5205361ca97d52c1aae
diff --git a/router.go b/router.go index <HASH>..<HASH> 100644 --- a/router.go +++ b/router.go @@ -60,7 +60,6 @@ func (router *Router) On(name string, callback interface{}) { callbackDataType := reflect.TypeOf(callback).In(1) - fmt.Println(callbackDataType, reflect.TypeOf([]byte{})) if reflect.TypeOf([]byte{}) == callbackDataType { router.callbacks[name] = callback.(func(*Connection, []byte)) return @@ -69,7 +68,7 @@ func (router *Router) On(name string, callback interface{}) { callbackValue := reflect.ValueOf(callback) callbackDataElem := callbackDataType.Elem() - preCallbackParser := func(conn *Connection, data []byte) { + unmarshalThenCallback := func(conn *Connection, data []byte) { result := reflect.New(callbackDataElem) err := json.Unmarshal(data, &result) @@ -80,7 +79,7 @@ func (router *Router) On(name string, callback interface{}) { fmt.Println("[JSON-FORWARD]", data, err) // TODO: Proper debug output! } } - router.callbacks[name] = preCallbackParser + router.callbacks[name] = unmarshalThenCallback } func (router *Router) parse(conn *Connection, rawdata []byte) {
Got rid of debug output and renamed functor.
trevex_golem
train
go
5383450a6a35f856084cefbffd9ef1fbc4e59084
diff --git a/config/webpack.dev.js b/config/webpack.dev.js index <HASH>..<HASH> 100644 --- a/config/webpack.dev.js +++ b/config/webpack.dev.js @@ -87,8 +87,10 @@ module.exports = webpackMerge(commonConfig, { * * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename */ - chunkFilename: '[id].chunk.js' + chunkFilename: '[id].chunk.js', + library: 'ac_[name]', + libraryTarget: 'var', }, plugins: [
chore: provide var lib for dev
inchingorg_xdata-web
train
js
492340090fe60c41139637f081c5d2e4ab0ee8c3
diff --git a/proso/release.py b/proso/release.py index <HASH>..<HASH> 100644 --- a/proso/release.py +++ b/proso/release.py @@ -1 +1 @@ -VERSION = '3.20.4' +VERSION = '3.20.5.dev'
start working on <I>.dev
adaptive-learning_proso-apps
train
py
dab314900daf2368eb323e35b68e77de2d2740f5
diff --git a/dockerscripts/healthcheck.go b/dockerscripts/healthcheck.go index <HASH>..<HASH> 100755 --- a/dockerscripts/healthcheck.go +++ b/dockerscripts/healthcheck.go @@ -83,6 +83,11 @@ func findEndpoint() string { if strings.Count(addr, ":") > 0 { addr = strings.Join([]string{"[", addr, "]"}, "") } + // wait for cmd to complete before return + if err = cmd.Wait(); err != nil { + // command failed to run + log.Fatal(err.Error()) + } // return joint address and port return strings.Join([]string{addr, port}, ":") }
Fix healthcheck script to wait for netstat command output (#<I>) Fixes #<I>
minio_minio
train
go
03183a58af634ebebe433560571cbb8de0c496c5
diff --git a/impl/src/main/java/org/apache/camel/cdi/Main.java b/impl/src/main/java/org/apache/camel/cdi/Main.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/apache/camel/cdi/Main.java +++ b/impl/src/main/java/org/apache/camel/cdi/Main.java @@ -90,14 +90,10 @@ public class Main extends MainSupport { cdiContainer = container; super.doStart(); postProcessContext(); - for (CamelContext context : getCamelContexts()) - context.start(); } @Override protected void doStop() throws Exception { - for (CamelContext context : getCamelContexts()) - context.stop(); super.doStop(); if (cdiContainer != null) ((org.apache.deltaspike.cdise.api.CdiContainer) cdiContainer).shutdown();
Remove Camel contexts lifecycle management in Main support
astefanutti_camel-cdi
train
java
3ebcd23e32e5f78cbc3938bcaa654d8369b5e082
diff --git a/src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java b/src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java index <HASH>..<HASH> 100644 --- a/src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java +++ b/src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java @@ -22,6 +22,7 @@ public class TestCommand<C extends Configuration> extends EnvironmentCommand<C> public TestCommand(final Application<C> application) { super(application, "guicey-test", "Specific command to run guice context without jetty server"); + cleanupAsynchronously(); configurationClass = application.getConfigurationClass(); } @@ -41,6 +42,7 @@ public class TestCommand<C extends Configuration> extends EnvironmentCommand<C> throw new IllegalStateException("Failed to stop managed objects container", e); } container.destroy(); + cleanup(); } @Override
Make test command clean up asynchornously
xvik_dropwizard-guicey
train
java
57ce997693bdbf36fe251205e38520b6d92054db
diff --git a/examples/gae/showcase/main.py b/examples/gae/showcase/main.py index <HASH>..<HASH> 100644 --- a/examples/gae/showcase/main.py +++ b/examples/gae/showcase/main.py @@ -2,12 +2,17 @@ import os import logging +import sys +reload(sys) +sys.setdefaultencoding('utf-8') import jinja2 import webapp2 from authomatic import Authomatic from authomatic.adapters import Webapp2Adapter + + # import config import config_public as config
Fixed utf-8 error.
authomatic_authomatic
train
py
678107dc2a6e42df2e4a77354ba0454b65bc2eff
diff --git a/openpnm/core/ModelsMixin.py b/openpnm/core/ModelsMixin.py index <HASH>..<HASH> 100644 --- a/openpnm/core/ModelsMixin.py +++ b/openpnm/core/ModelsMixin.py @@ -284,7 +284,17 @@ class ModelsMixin(): try: self[prop] = model(target=self, **kwargs) except KeyError: - logger.warning(prop+' was not run due to missing dependencies') + missing_deps = [] + for key in kwargs.values(): + if type(key) == str and key.split('.')[0] in ['pore', 'throat']: + try: + self[key] + except KeyError: + missing_deps.append(key) + + logger.warning(prop+' was not run since the following' + + ' properties are missing: ' + + str(missing_deps)) self.models[prop]['regen_mode'] = 'deferred' def remove_model(self, propname=None, mode=['model', 'data']):
Enhancing missing dependencies check...seems to work!
PMEAL_OpenPNM
train
py
9c7a452d3ceb9ac24894452aa184147930343e6f
diff --git a/dsync.go b/dsync.go index <HASH>..<HASH> 100644 --- a/dsync.go +++ b/dsync.go @@ -45,8 +45,8 @@ func SetNodesWithClients(rpcClnts []RPC, rpcOwnNode int) (err error) { // Validate if number of nodes is within allowable range. if dnodeCount != 0 { return errors.New("Cannot reinitialize dsync package") - } else if len(rpcClnts) < 4 { - return errors.New("Dsync not designed for less than 4 nodes") + } else if len(rpcClnts) < 2 { + return errors.New("Dsync not designed for less than 2 nodes") } else if len(rpcClnts) > 16 { return errors.New("Dsync not designed for more than 16 nodes") } else if len(rpcClnts)&1 == 1 {
Relax minimum number of nodes to 2 Now that we have relaxed the quorum for reads to N/2, it actually makes sense to lower the minimum number of nodes from 4 down to 2. This means that for a 2 node system, both nodes need to be up in order to acquire a (write) lock. To obtain a read lock just a single node (which one doesn't matter) needs to be up.
minio_dsync
train
go
f66a7fa1453b437a96622d571fd38b0311561351
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifParser.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifParser.java index <HASH>..<HASH> 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifParser.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifParser.java @@ -979,7 +979,7 @@ public class SimpleMMcifParser implements MMcifParser { Type[] gpType = m.getGenericParameterTypes(); // all of the mmCif container classes have only one argument (they are beans) - if ( pType[0].getTypeName().equals(Integer.class.getName())) { + if ( pType[0].getName().equals(Integer.class.getName())) { if ( val != null && ! val.equals("?")) { Integer intVal = Integer.parseInt(val);
don;t use Java 8 specific method names
biojava_biojava
train
java
59f598d6392658c16cb547bb4fb7eb3345e1bfe9
diff --git a/src/Dev/DevelopmentAdmin.php b/src/Dev/DevelopmentAdmin.php index <HASH>..<HASH> 100644 --- a/src/Dev/DevelopmentAdmin.php +++ b/src/Dev/DevelopmentAdmin.php @@ -148,12 +148,14 @@ class DevelopmentAdmin extends Controller */ protected static function get_links() { - $links = array(); + $links = []; $reg = Config::inst()->get(__CLASS__, 'registered_controllers'); foreach ($reg as $registeredController) { - foreach ($registeredController['links'] as $url => $desc) { - $links[$url] = $desc; + if (isset($registeredController['links'])) { + foreach ($registeredController['links'] as $url => $desc) { + $links[$url] = $desc; + } } } return $links;
Added isset check for registered controller links in dev admin
silverstripe_silverstripe-framework
train
php
a88cae99955cd0ccdd5d99a1c6d506029eb15c60
diff --git a/public/javascripts/streamrules.js b/public/javascripts/streamrules.js index <HASH>..<HASH> 100644 --- a/public/javascripts/streamrules.js +++ b/public/javascripts/streamrules.js @@ -25,7 +25,7 @@ $(document).ready(function() { value = $(this).attr("placeholder"); } - $($(this).attr("data-reflect"), modalBody).html(value); + $($(this).attr("data-reflect"), modalBody).text(value); }); $(".streamrules-list").on("click", "li a.remove-streamrule", function(event) { @@ -69,7 +69,7 @@ $(document).ready(function() { new_val = old_val; } } - $("#sr-result-category", modalBody).html(new_val); + $("#sr-result-category", modalBody).text(new_val); }) $(document.body).on("click", "button.streamrule-form-submit", function(e) {
use .text() not .html() in stream rule editor to prevent DOM XSS fixes #<I>
Graylog2_graylog2-server
train
js
725b0129965dbe8152dc6023d62912af5317e119
diff --git a/ipa/ipa_utils.py b/ipa/ipa_utils.py index <HASH>..<HASH> 100644 --- a/ipa/ipa_utils.py +++ b/ipa/ipa_utils.py @@ -100,30 +100,6 @@ def ssh_connect(client, ) -@contextmanager -def ssh_connection(client, - ip, - ssh_private_key, - ssh_user='root', - port=22): - """Redirect standard out to file.""" - try: - wait_on_ssh_connection( - client, - ip, - ssh_private_key, - ssh_user, - port - ) - yield client - except: - print('Error!') - raise - finally: - if client: - client.close() - - def wait_on_ssh_connection(client, ip, ssh_private_key,
Remove unused context manager for SSH connections.
SUSE-Enceladus_ipa
train
py
1143f35a532c40995d03b2d9ee7a36ef4a9b7925
diff --git a/openquake/baselib/parallel.py b/openquake/baselib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/parallel.py +++ b/openquake/baselib/parallel.py @@ -397,6 +397,7 @@ def safely_call(func, args, monitor=dummy_mon): zsocket.send(err) if res.tb_str == 'TASK_ENDED': break + mon.duration = 0 return zsocket.num_sent
Fixed monitor times [skip CI]
gem_oq-engine
train
py
e6d4964f80e6a8311e6b82e04844c262d0fa7855
diff --git a/app/helpers/siesta/application_helper.rb b/app/helpers/siesta/application_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/siesta/application_helper.rb +++ b/app/helpers/siesta/application_helper.rb @@ -9,10 +9,10 @@ module Siesta end def include_test_harness - if asset_exists?('test_harness.js') - javascript_include_tag 'test_harness' - else + if Siesta.config.auto_organizing content_tag(:script, test_harness, { type: 'text/javascript' }, false) + else + javascript_include_tag 'test_harness' end end
Do not check the existance of `test_harness.js`
towerhe_siesta
train
rb
016576d839c0f45f3a0c8f0fa60dffe91db12847
diff --git a/tasks/protractor_coverage.js b/tasks/protractor_coverage.js index <HASH>..<HASH> 100644 --- a/tasks/protractor_coverage.js +++ b/tasks/protractor_coverage.js @@ -103,11 +103,11 @@ module.exports = function(grunt) { coverageDir = coverageDir.replace(/\\/g,'/'); var noInject = opts.noInject; if (!noInject) { - var saveCucumberCoverageTemplate = grunt.file.expand([ opts.saveCoverageTemplate, "node_modules/grunt-protractor-coverage/resources/saveCoverage.tmpl", process.cwd()+'/**/resources/saveCoverage.tmpl']).shift(); - if(!saveCucumberCoverageTemplate){ + saveCoverageTemplate = grunt.file.expand([ opts.saveCoverageTemplate, "node_modules/grunt-protractor-coverage/resources/saveCoverage.tmpl", process.cwd()+'/**/resources/saveCoverage.tmpl']).shift(); + if(!saveCoverageTemplate){ grunt.fail.fatal("Coverage template file not found."); } - var saveCoverageSource = grunt.file.read(saveCucumberCoverageTemplate); + var saveCoverageSource = grunt.file.read(saveCoverageTemplate); var saveCoverageContent=grunt.template.process( saveCoverageSource, { data: { dirname: coverageDir,
Renamed incorrectly renamed variable back to original
r3b_grunt-protractor-coverage
train
js
116f2e5eb6d4c989418f57b0b3748ce0edfc1554
diff --git a/tests/setup.py b/tests/setup.py index <HASH>..<HASH> 100644 --- a/tests/setup.py +++ b/tests/setup.py @@ -13,7 +13,6 @@ PACKAGE_NAME = 'asn1crypto' PACKAGE_VERSION = '1.3.0' TEST_PACKAGE_NAME = '%s_tests' % PACKAGE_NAME TESTS_ROOT = os.path.dirname(os.path.abspath(__file__)) -PACKAGE_ROOT = os.path.abspath(os.path.join(TESTS_ROOT, '..')) # setuptools 38.6.0 and newer know about long_description_content_type, but @@ -60,7 +59,7 @@ class EggInfoCommand(egg_info): if not os.path.exists(egg_info_path): os.mkdir(egg_info_path) shutil.copy2( - os.path.join(PACKAGE_ROOT, 'LICENSE'), + os.path.join(TESTS_ROOT, 'LICENSE'), os.path.join(egg_info_path, 'LICENSE') ) egg_info.run(self)
Fix an issue with asn1crypto_tests when running egg_info from sdist
wbond_asn1crypto
train
py
b560910b06b3ba90a7091fd56ee2e2094bb199f1
diff --git a/lib/wed/wed.js b/lib/wed/wed.js index <HASH>..<HASH> 100644 --- a/lib/wed/wed.js +++ b/lib/wed/wed.js @@ -825,14 +825,14 @@ Editor.prototype._postInitialize = log.wrap(function () { } } - this.validator.start(); - this.domlistener.processImmediately(); // Flush whatever has happened earlier. this._undo = new undo.UndoList(); this.$gui_root.focus(); + this.validator.start(); + this._setCondition("initialized", {editor: this}); });
Start validation just before ending the initialization process.
mangalam-research_wed
train
js
6b953df7f96e4edb4fc2537b6def539708c5c194
diff --git a/packages/eqh-client-vault/src/.eslintrc.js b/packages/eqh-client-vault/src/.eslintrc.js index <HASH>..<HASH> 100644 --- a/packages/eqh-client-vault/src/.eslintrc.js +++ b/packages/eqh-client-vault/src/.eslintrc.js @@ -10,5 +10,11 @@ module.exports = { sourceType: 'module', }, }, + { + files: ['main.js', 'util/*.js'], + env: { + browser: true, + }, + }, ], } diff --git a/packages/eqh-client-vault/src/main.js b/packages/eqh-client-vault/src/main.js index <HASH>..<HASH> 100644 --- a/packages/eqh-client-vault/src/main.js +++ b/packages/eqh-client-vault/src/main.js @@ -1,5 +1,3 @@ -/* eslint-disable no-undef */ - import { safeHtml } from 'common-tags' import loadVault from './vault'
Change eslint env to browser for main.js in vault
BlockchainZoo_keyhub-vault
train
js,js
1f4abe7eb664fa1f46a3e2df60b7cb9095b6fcd9
diff --git a/xdis/cross_dis.py b/xdis/cross_dis.py index <HASH>..<HASH> 100644 --- a/xdis/cross_dis.py +++ b/xdis/cross_dis.py @@ -328,7 +328,10 @@ def xstack_effect(opcode, opc, oparg=None, jump=None): elif opname == "MAKE_FUNCTION": if opc.version >= 3.5: if 0 <= oparg <= 10: - return [-1, -2, -2, -3, -2, -3, -3 , -4, -2, -3, -3, -4][oparg] + if opc.version == 3.5: + return [-1, -2, -3, -3, -2, -3, -3 , -4, -2, -3, -3, -4][oparg] + elif opc.version >= 3.6: + return [-1, -2, -2, -3, -2, -3, -3 , -4, -2, -3, -3, -4][oparg] else: return None elif opname == "CALL_FUNCTION_EX":
Last <I> stack effect correction before release
rocky_python-xdis
train
py
975337f339a872e960063e8114a23a3921fabf96
diff --git a/exchange_actions/exchange_actions.go b/exchange_actions/exchange_actions.go index <HASH>..<HASH> 100644 --- a/exchange_actions/exchange_actions.go +++ b/exchange_actions/exchange_actions.go @@ -7,7 +7,6 @@ import ( "path" "path/filepath" "sort" - "strings" "time" "github.com/qor/i18n" @@ -102,7 +101,12 @@ func RegisterExchangeJobs(I18n *i18n.I18n, Worker *worker.Worker) { for _, values := range records[1:] { for idx, value := range values[1:] { - if strings.Contains(values[0], "Amount") { + if value == "" { + I18n.DeleteTranslation(&i18n.Translation{ + Key: values[0], + Locale: locales[idx], + }) + } else { I18n.SaveTranslation(&i18n.Translation{ Key: values[0], Locale: locales[idx],
Delete translation if translation value is blank string
qor_i18n
train
go
d848751d648c82e47960efd8c5c406a0f00ed5bf
diff --git a/assets/js/postmessage.js b/assets/js/postmessage.js index <HASH>..<HASH> 100755 --- a/assets/js/postmessage.js +++ b/assets/js/postmessage.js @@ -25,6 +25,7 @@ } }, _base_url); }, + _hasParent = ('' !== _parent_url), $window = $(window), $html = $('html'); @@ -58,8 +59,14 @@ // Post height of a child right after window is loaded. $(window).bind('load', function () { FS.PostMessage.postHeight(); - }); + // Post message that window was loaded. + FS.PostMessage.post('loaded'); + }); + }, + hasParent : function () + { + return _hasParent; }, postHeight : function (diff, wrapper) { diff = diff || 0;
[post-message] [bug-fix] Fixed issues after bad file merge.
Freemius_wordpress-sdk
train
js
c38a504290f1835948e15144295b38106a5bad83
diff --git a/gems/rake-support/lib/torquebox/deploy_utils.rb b/gems/rake-support/lib/torquebox/deploy_utils.rb index <HASH>..<HASH> 100644 --- a/gems/rake-support/lib/torquebox/deploy_utils.rb +++ b/gems/rake-support/lib/torquebox/deploy_utils.rb @@ -310,7 +310,7 @@ module TorqueBox Thread.new(stdin) { |stdin_io| begin until exiting - stdin_io.write(STDIN.readpartial(1024)) + stdin_io.write(readpartial(STDIN)) stdin_io.flush end rescue Errno::EBADF, IOError @@ -322,7 +322,7 @@ module TorqueBox [ Thread.new(stdout) { |stdout_io| begin while true - STDOUT.write(stdout_io.readpartial(1024)) + STDOUT.write(readpartial(stdout_io)) end rescue EOFError end @@ -331,7 +331,7 @@ module TorqueBox Thread.new(stderr) { |stderr_io| begin while true - STDERR.write(stderr_io.readpartial(1024)) + STDERR.write(readpartial(stderr_io)) end rescue EOFError end @@ -341,6 +341,10 @@ module TorqueBox end + def readpartial(stream) + windows? ? stream.read(1) : stream.readpartial(1024) + end + def windows? RbConfig::CONFIG['host_os'] =~ /mswin/ end
fall back to read(1) on Windows instead of readpartial
torquebox_torquebox
train
rb
d426b1e0d0d97786c6c81b4987f9d4e07807de1c
diff --git a/lib/Pool.js b/lib/Pool.js index <HASH>..<HASH> 100644 --- a/lib/Pool.js +++ b/lib/Pool.js @@ -116,6 +116,7 @@ Pool.prototype._createConnection = function() { // the connection to end as well, thus we only need to watch for the end event // and we will be notified of disconnects. connection.on('end', this._handleConnectionEnd.bind(this, connection)); + connection.on('error', this._handleConnectionError.bind(this, connection)); return connection; }; @@ -127,6 +128,13 @@ Pool.prototype._handleConnectionEnd = function(connection) { this._removeConnection(connection); }; +Pool.prototype._handleConnectionError = function(connection) { + if (this._closed || connection._poolRemoved) { + return; + } + this._removeConnection(connection); +}; + Pool.prototype._removeConnection = function(connection) { connection._poolRemoved = true; for (var i = 0; i < this._allConnections.length; ++i) {
Changes Pool to handle 'error' events and dispose connection
sidorares_node-mysql2
train
js
5c329b4875e0b6e592aae03b45b5c298576492ff
diff --git a/lib/Cake/Utility/CakeTime.php b/lib/Cake/Utility/CakeTime.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Utility/CakeTime.php +++ b/lib/Cake/Utility/CakeTime.php @@ -1041,7 +1041,7 @@ class CakeTime { /** * Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string. - * It take in account the default date format for the current language if a LC_TIME file is used. + * It takes into account the default date format for the current language if a LC_TIME file is used. * * @param integer|string|DateTime $date UNIX timestamp, strtotime() valid string or DateTime object * @param string $format strftime format string.
Updated CakeTime::i<I>nFormat() doc block description
cakephp_cakephp
train
php
ef16437974500d3599c84fed484ba50087c1b7de
diff --git a/aiodocker/__init__.py b/aiodocker/__init__.py index <HASH>..<HASH> 100644 --- a/aiodocker/__init__.py +++ b/aiodocker/__init__.py @@ -1,7 +1,7 @@ from .docker import Docker -__version__ = '0.11.0' +__version__ = '0.12.0a0' __all__ = ("Docker", )
Bump to next alpha. (#<I>)
aio-libs_aiodocker
train
py
ed39e045ee216314fbea9a287cd14d97b3083611
diff --git a/keyboard/_darwinkeyboard.py b/keyboard/_darwinkeyboard.py index <HASH>..<HASH> 100644 --- a/keyboard/_darwinkeyboard.py +++ b/keyboard/_darwinkeyboard.py @@ -142,6 +142,10 @@ class KeyMap(object): def character_to_vk(self, character): """ Returns a tuple of (scan_code, modifiers) where ``scan_code`` is a numeric scan code and ``modifiers`` is an array of string modifier names (like 'shift') """ + # Mapping to preserve cross-platform hotkeys + if character.lower() == "windows": + character = "command" + for vk in self.non_layout_keys: if self.non_layout_keys[vk] == character.lower(): return (vk, []) diff --git a/keyboard/_keyboard_event.py b/keyboard/_keyboard_event.py index <HASH>..<HASH> 100644 --- a/keyboard/_keyboard_event.py +++ b/keyboard/_keyboard_event.py @@ -64,7 +64,7 @@ canonical_names = { 'win': 'windows', # Mac keys - 'command': 'command', + 'command': 'windows', 'control': 'ctrl', 'option': 'alt',
Mapping "windows" to "command" Reverted change in _keyboard_event to preserve cross-platform hotkeys; added mapping in _darwinkeyboard instead.
boppreh_keyboard
train
py,py
dc75f25ab80a036f9a9fd348669174208ece98d6
diff --git a/sos/plugins/usb.py b/sos/plugins/usb.py index <HASH>..<HASH> 100644 --- a/sos/plugins/usb.py +++ b/sos/plugins/usb.py @@ -17,15 +17,16 @@ from glob import glob import os class Usb(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): - """USB subsystem information + """USB device related information """ plugin_name = "usb" def setup(self): self.add_copy_spec("/sys/bus/usb") - + self.add_cmd_output("lsusb") self.add_cmd_output("lsusb -v") self.add_cmd_output("lsusb -t") +
Tidy up description and code formatting in usb plug-in
sosreport_sos
train
py
1f29b8e6746e6a87875bb4cb18d75edefc888a46
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -99,7 +99,7 @@ window.CodeMirror = (function() { function makeDisplay(place, docStart) { var d = {}; - var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;"); + var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); if (webkit) input.style.width = "1000px"; else input.setAttribute("wrap", "off"); // if border: 0; -- iOS fails to open keyboard (issue #1287)
Remove tiny font on hidden textarea It causes autozooming on some mobile platforms. Closes #<I>
codemirror_CodeMirror
train
js
3f1728907126e3fb009ae8652bdc4bb333f13f31
diff --git a/src/Worker.php b/src/Worker.php index <HASH>..<HASH> 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -83,26 +83,9 @@ class Worker */ public function send(string $payload = null, string $header = null): void { - if ($header === null) { - $this->relay->send('', Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_NONE); - } else { - $this->relay->send($header, Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW); - } - - $this->relay->send((string)$payload, Relay::PAYLOAD_RAW); - } - - /** - * Respond to the server with result of task execution and execution context. Uses less amount of sys_calls. - * - * @param string|null $payload - * @param string|null $header - */ - public function sendPackage(string $payload = null, string $header = null): void - { $this->relay->sendPackage( (string)$header, - Relay::PAYLOAD_CONTROL | ($header ? Relay::PAYLOAD_NONE : Relay::PAYLOAD_RAW), + Relay::PAYLOAD_CONTROL | ($header === null ? Relay::PAYLOAD_NONE : Relay::PAYLOAD_RAW), (string)$payload, Relay::PAYLOAD_RAW );
#<I> Replace multiple sys_calls with a combined one
spiral_roadrunner
train
php
d33e683daf43d4b078c793d91d4f5d73105ac7a0
diff --git a/Classes/Service/HttpPush/ImageHttpPush.php b/Classes/Service/HttpPush/ImageHttpPush.php index <HASH>..<HASH> 100644 --- a/Classes/Service/HttpPush/ImageHttpPush.php +++ b/Classes/Service/HttpPush/ImageHttpPush.php @@ -56,7 +56,7 @@ class ImageHttpPush extends AbstractHttpPush return []; } - \preg_match_all('/(?<=["\'])[^="\']*\.(' . $this->lastExtension . ')\.*\d*\.*(?=["\'])/', $content, $imagesFiles); + \preg_match_all('/(?<=["\'])[^="\'\\\\]*\.(' . $this->lastExtension . ')\.*\d*\.*(?=["\'])/', $content, $imagesFiles); $paths = $this->streamlineFilePaths((array)$imagesFiles[0]); return $this->mapPathsWithType($paths, 'image');
[BUGFIX] Do not detect images in JSON files
lochmueller_staticfilecache
train
php
0b5b5a67e31d1597ce6ff9ec84afdaea743b5e85
diff --git a/rah_bitly.php b/rah_bitly.php index <HASH>..<HASH> 100644 --- a/rah_bitly.php +++ b/rah_bitly.php @@ -179,9 +179,9 @@ class rah_bitly { public function update($event, $step, $r) { - global $app_mode; + global $app_mode, $ID; - $this->permlink = permlinkurl_id($r['ID']); + $this->permlink = permlinkurl_id($ID ? $ID : $r['ID']); callback_event('rah_bitly.update');
ID isn't available on article_posted event. Need to use the global $ID.
gocom_rah_bitly
train
php
07a7a1cdcb0a5fba73ed10388cc2c84ff7e9e144
diff --git a/core/src/main/java/org/jboss/hal/core/elytron/CredentialReference.java b/core/src/main/java/org/jboss/hal/core/elytron/CredentialReference.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/jboss/hal/core/elytron/CredentialReference.java +++ b/core/src/main/java/org/jboss/hal/core/elytron/CredentialReference.java @@ -111,7 +111,7 @@ public class CredentialReference { Metadata crMetadata = metadata.forComplexAttribute(credentialReferenceName); EmptyState.Builder emptyStateBuilder = new EmptyState.Builder( - Ids.build(baseId, credentialReferenceName, Ids.EMPTY), + Ids.build(baseId, credentialReferenceName, Ids.FORM, Ids.EMPTY), resources.constants().noResource()); if (crMetadata.getSecurityContext().isWritable()) {
Change ID for empty state in cred-ref forms
hal_console
train
java
28e563eeae79640923d4f829b48b8803d1178993
diff --git a/integration-tests/src/test/java/tachyon/master/MasterFaultToleranceIntegrationTest.java b/integration-tests/src/test/java/tachyon/master/MasterFaultToleranceIntegrationTest.java index <HASH>..<HASH> 100644 --- a/integration-tests/src/test/java/tachyon/master/MasterFaultToleranceIntegrationTest.java +++ b/integration-tests/src/test/java/tachyon/master/MasterFaultToleranceIntegrationTest.java @@ -155,6 +155,8 @@ public class MasterFaultToleranceIntegrationTest { } } + // TODO: Resolve the issue with HDFS as UnderFS + @Ignore @Test public void createFilesTest() throws Exception { int clients = 10; @@ -172,6 +174,8 @@ public class MasterFaultToleranceIntegrationTest { } } + // TODO: Resolve the issue with HDFS as UnderFS + @Ignore @Test public void killStandbyTest() throws Exception { // If standby masters are killed(or node failure), current leader should not be affected and the
All cases can not pass in hdfs1Test profile cannot pass in hdfs
Alluxio_alluxio
train
java
80e3b270cf93044ec2000b2d1227617e7d919a95
diff --git a/lib/tumugi/logger/scoped_logger.rb b/lib/tumugi/logger/scoped_logger.rb index <HASH>..<HASH> 100644 --- a/lib/tumugi/logger/scoped_logger.rb +++ b/lib/tumugi/logger/scoped_logger.rb @@ -4,7 +4,8 @@ require 'forwardable' module Tumugi class ScopedLogger extend Forwardable - def_delegators :@logger, :debug?, :error?, :fatal?, :info?, :warn?, :level + def_delegators :@logger, :init, :verbose!, :quiet!, :workflow_id, :workflow_id=, + :debug?, :error?, :fatal?, :info?, :warn?, :level def initialize(scope) @scope = scope
Add delgationm method to Logger
tumugi_tumugi
train
rb
f8200b134f6d8f992fbd77a05d46d8ba1dce99a1
diff --git a/pythonforandroid/build.py b/pythonforandroid/build.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/build.py +++ b/pythonforandroid/build.py @@ -669,8 +669,12 @@ def run_pymodules_install(ctx, modules): venv = sh.Command(ctx.virtualenv) with current_directory(join(ctx.build_dir)): shprint(venv, - '--python=python{}'.format(ctx.python_recipe.major_minor_version_string), - 'venv') + '--python=python{}'.format( + ctx.python_recipe.major_minor_version_string. + partition(".")[0] + ), + 'venv' + ) info('Creating a requirements.txt file for the Python modules') with open('requirements.txt', 'w') as fileh:
Fix incorrect assumption that OS python minor version matches hostpython
kivy_python-for-android
train
py
188def28733770214ebb28476e2c94137a9ca220
diff --git a/app/mailers/activity_notification/mailer.rb b/app/mailers/activity_notification/mailer.rb index <HASH>..<HASH> 100644 --- a/app/mailers/activity_notification/mailer.rb +++ b/app/mailers/activity_notification/mailer.rb @@ -4,7 +4,6 @@ if defined?(ActionMailer) include ActivityNotification::Mailers::Helpers # Sends notification email - # # @param [Notification] notification Notification instance to send email # @param [Hash] options Options for notification email # @option options [String, Symbol] :fallback (:default) Fallback template to use when MissingTemplate is raised
Update mailer to complete docs
simukappu_activity_notification
train
rb
55928276939ad6bdaf10a8d84ece9d166997af34
diff --git a/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java b/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java index <HASH>..<HASH> 100644 --- a/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java +++ b/spring-ldap/src/main/java/org/springframework/ldap/core/support/AbstractContextSource.java @@ -281,10 +281,10 @@ public abstract class AbstractContextSource implements ContextSource, + "using default implementation"); if (StringUtils.isBlank(userDn)) { log - .warn("Property 'userDn' not set - " + .info("Property 'userDn' not set - " + "anonymous context will be used for read-write operations"); } else if (StringUtils.isBlank(password)) { - log.warn("Property 'password' not set - " + log.info("Property 'password' not set - " + "blank password will be used"); } authenticationSource = new SimpleAuthenticationSource();
Fix for LDAP-<I>: modified log level for blank userDn and password.
spring-projects_spring-ldap
train
java
0f458d7df5b9419ba9e8d68961f2ead197025d24
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -290,6 +290,7 @@ SETUP_KWARGS = {'name': NAME, 'packages': ['salt', 'salt.cli', 'salt.client', + 'salt.client.ssh', 'salt.ext', 'salt.auth', 'salt.wheel',
include salt.client.ssh in setup.py
saltstack_salt
train
py
45bf0df21a53809a891ea5bb45e5407a2ebb5e02
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -30,7 +30,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "14.0" +DEFAULT_VERSION = "14.1" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" DEFAULT_SAVE_DIR = os.curdir diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '14.0' +__version__ = '14.1'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py,py
65656f49b8ebcd1c4760adf56cde5c4fc1f46722
diff --git a/lib/event_listeners.js b/lib/event_listeners.js index <HASH>..<HASH> 100644 --- a/lib/event_listeners.js +++ b/lib/event_listeners.js @@ -359,7 +359,7 @@ AWS.EventListeners = { code: 'UnknownEndpoint', region: err.region, hostname: err.hostname, - retryable: false, + retryable: true, originalError: err }); }
set ENOTFOUND_ERROR errors to be retryable
aws_aws-sdk-js
train
js
e3602036f344253d0d3a19b74c6251554e0f4acb
diff --git a/plumbing/transport/common.go b/plumbing/transport/common.go index <HASH>..<HASH> 100644 --- a/plumbing/transport/common.go +++ b/plumbing/transport/common.go @@ -94,7 +94,7 @@ type ReceivePackSession interface { // Endpoint represents a Git URL in any supported protocol. type Endpoint struct { - // Protocol is the protocol of the endpoint (e.g. git, https, file). I + // Protocol is the protocol of the endpoint (e.g. git, https, file). Protocol string // User is the user. User string
plumbing/transport: Fix truncated comment in Endpoint
src-d_go-git
train
go
4f2f3cd7f21e3e9ca6d2644cf34c36c488797a5d
diff --git a/pypeerassets/kutil.py b/pypeerassets/kutil.py index <HASH>..<HASH> 100644 --- a/pypeerassets/kutil.py +++ b/pypeerassets/kutil.py @@ -25,7 +25,10 @@ class Kutil: self.network = network try: - setup(self.network) + if self.network.startswith('t'): + setup('testnet') + else: + setup('mainnet') except ValueError: pass
workaround to let btcpy know is it testnet or mainnet
PeerAssets_pypeerassets
train
py
356c35d3c70084486e112327e34e3e747d8931aa
diff --git a/Serializer/GraphNavigator.php b/Serializer/GraphNavigator.php index <HASH>..<HASH> 100644 --- a/Serializer/GraphNavigator.php +++ b/Serializer/GraphNavigator.php @@ -95,8 +95,18 @@ final class GraphNavigator */ public function accept($data, array $type = null, VisitorInterface $visitor) { - // determine type if not given + // If the type was not given, we infer the most specific type from the + // input data in serialization mode. if (null === $type) { + if (self::DIRECTION_DESERIALIZATION === $this->direction) { + $msg = 'The type must be given for all properties when deserializing.'; + if (null !== $path = $this->getCurrentPath()) { + $msg .= ' Path: '.$path; + } + + throw new \RuntimeException($msg); + } + if (null === $data) { return null; }
added a sanity check
alekitto_serializer
train
php
3e5a0119ede45b7b65db216e9783b7e0f593f3a3
diff --git a/nodeconductor/cloud/backend/openstack.py b/nodeconductor/cloud/backend/openstack.py index <HASH>..<HASH> 100644 --- a/nodeconductor/cloud/backend/openstack.py +++ b/nodeconductor/cloud/backend/openstack.py @@ -209,7 +209,7 @@ class OpenStackBackend(object): def get_resource_stats(self, auth_url): try: credentials = self.get_credentials(auth_url) - nova = self.get_nova_client(credentials) + nova = self.get_nova_client(**credentials) return nova.hypervisors.statistics()._info except (nova_exceptions.ClientException, keystone_exceptions.ClientException): logger.exception('Failed to get statics for auth_url: %s', auth_url)
Unpack credentials into a kwargs
opennode_waldur-core
train
py
4c8f36275aa17e535475f5e645ad0a2044007a68
diff --git a/lib/htmlToXlsx.js b/lib/htmlToXlsx.js index <HASH>..<HASH> 100644 --- a/lib/htmlToXlsx.js +++ b/lib/htmlToXlsx.js @@ -111,7 +111,6 @@ module.exports = function (reporter, definition) { if (reporter.compilation) { reporter.compilation.resourceInTemp('htmlToXlsxConversionScript.js', path.join(path.dirname(require.resolve('html-to-xlsx')), 'lib', 'scripts', 'conversionScript.js')) - reporter.compilation.resourceDirectoryInTemp('xlsxTemplate', path.join(path.dirname(require.resolve('msexcel-builder-extended')), 'tmpl')) } definition.options.tmpDir = reporter.options.tempAutoCleanupDirectory @@ -122,7 +121,6 @@ module.exports = function (reporter, definition) { if (reporter.execution) { options.conversionScriptPath = reporter.execution.resourceTempPath('htmlToXlsxConversionScript.js') - options.xlsxTemplatePath = reporter.execution.resourceTempPath('xlsxTemplate') } if (reporter.compilation) {
don’t require msexcel-builder-extended (it is not used)
jsreport_jsreport-html-to-xlsx
train
js
db5df8d19f157eab4e9d93525dc22d1e73b4614e
diff --git a/go/mysql/collations/integration/main_test.go b/go/mysql/collations/integration/main_test.go index <HASH>..<HASH> 100644 --- a/go/mysql/collations/integration/main_test.go +++ b/go/mysql/collations/integration/main_test.go @@ -38,6 +38,8 @@ var ( var waitmysql = flag.Bool("waitmysql", false, "") func mysqlconn(t *testing.T) *mysql.Conn { + t.Skipf("temporarily disabled because of MySQL upgrade") + conn, err := mysql.Connect(context.Background(), &connParams) if err != nil { t.Fatal(err)
ci: temporarily disable integration tests
vitessio_vitess
train
go
1270e4d338d7948bdc0662ae5dd2520171604c27
diff --git a/bin/php-cs-fixer-config.php b/bin/php-cs-fixer-config.php index <HASH>..<HASH> 100644 --- a/bin/php-cs-fixer-config.php +++ b/bin/php-cs-fixer-config.php @@ -51,7 +51,6 @@ return 'php_closing_tag', 'single_line_after_imports', 'trailing_spaces', - 'function_call_space', 'operators_spaces',
Duplicate, already in here.
sabre-io_cs
train
php
b3fa19c0adf0bfb0fc3a85ba84261377cb4ed310
diff --git a/pysat/_meta.py b/pysat/_meta.py index <HASH>..<HASH> 100644 --- a/pysat/_meta.py +++ b/pysat/_meta.py @@ -456,7 +456,6 @@ class Meta(object): lower_keys = [k.lower() for k in value.keys()] # dictionary of labels (keys) and values (default value for attribute) default_dict = self.default_labels_and_values(name) - # for attr, defaults in default_dict: #zip(attrs, default_attrs): for attr in default_dict: #zip(attrs, default_attrs): # the metadata default values for attr are in defaults defaults = default_dict[attr] @@ -550,6 +549,10 @@ class Meta(object): elif isinstance(value, Meta): # dealing with higher order data set + + # if name is already used in meta object, use that one + # with preserved case + # otherwise, use name as provided if name in self: new_item_name = self.var_case_name(name) else: @@ -571,6 +574,11 @@ class Meta(object): value.data.index = new_names # assign Meta object now that things are consistent with Meta # object settings + # but first, make sure there are lower dimension metadata + # parameters, passing in an empty dict fills in defaults + # if there is no existing metadata info + self[new_item_name] = {} + # now add to higher order data self.ho_data[new_item_name] = value def __getitem__(self, key):
Modified meta assignment so lower dimensional parameters always present
rstoneback_pysat
train
py
b57cc0ecfa6d15c51192cbda6e1a282c9446fbb3
diff --git a/packages/openneuro-client/src/client.js b/packages/openneuro-client/src/client.js index <HASH>..<HASH> 100644 --- a/packages/openneuro-client/src/client.js +++ b/packages/openneuro-client/src/client.js @@ -69,6 +69,7 @@ const middlewareAuthLink = (uri, getAuthorization, fetch) => { uri, fetch, serverFormData: FormData, + credentials: 'same-origin', }) return authLink(getAuthorization).concat(httpUploadLink) }
Client: Include cookies on same-origin requests.
OpenNeuroOrg_openneuro
train
js
707ab2c1a120f05e02a8873f5d328e722d6334f2
diff --git a/src/Illuminate/Auth/EloquentUserProvider.php b/src/Illuminate/Auth/EloquentUserProvider.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Auth/EloquentUserProvider.php +++ b/src/Illuminate/Auth/EloquentUserProvider.php @@ -68,7 +68,7 @@ class EloquentUserProvider implements UserProviderInterface { */ public function updateRememberToken(UserInterface $user, $token) { - $user->setAttribute($user->getRememberTokenName(), $token); + $user->setRememberToken($token); $user->save(); }
Update EloquentUserProvider to use UserInterface#setRememberToken rather than Model#setAttribute directly. Closes #<I>.
laravel_framework
train
php
2ccad3f30126504ddff6910123ba12c36cac3584
diff --git a/tests/SpotifyWebAPITest.php b/tests/SpotifyWebAPITest.php index <HASH>..<HASH> 100644 --- a/tests/SpotifyWebAPITest.php +++ b/tests/SpotifyWebAPITest.php @@ -213,7 +213,7 @@ class SpotifyWebAPITest extends PHPUnit_Framework_TestCase ), array( 'id' => '3mqRLlD9j92BBv1ueFhJ1l', - 'positions' => array(1), + 'positions' => array(1, 2), ), array( 'id' => '4iV5W9uYEdYUVa79Axb7Rh', @@ -228,7 +228,7 @@ class SpotifyWebAPITest extends PHPUnit_Framework_TestCase 'uri' => 'spotify:track:1id6H6vcwSB9GGv9NXh5cl', ), array( - 'positions' => array(1), + 'positions' => array(1, 2), 'uri' => 'spotify:track:3mqRLlD9j92BBv1ueFhJ1l', ), array(
Test multiple positions in SpotifyWebAPI::deleteUserPlaylistTracks()
jwilsson_spotify-web-api-php
train
php
f98ff2f5cda72a801dc367390d34d5093aa22c0e
diff --git a/source/rafcon/gui/models/container_state.py b/source/rafcon/gui/models/container_state.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/models/container_state.py +++ b/source/rafcon/gui/models/container_state.py @@ -265,8 +265,7 @@ class ContainerStateModel(StateModel): return if isinstance(info.result, Exception): - exc_info = sys.exc_info() - raise exc_info[0], exc_info[1], exc_info[2] + pass elif "add" in info.method_name: self.add_missing_model(model_list, data_list, model_name, model_class, model_key) elif "remove" in info.method_name:
fix(container state model): remove re-raise and accept expected exceptions as result
DLR-RM_RAFCON
train
py
f8131cb6a575fde2a025d49a83cad242b283bb1d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,11 @@ setup( # project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/technical.html#install-requires-vs-requirements-files - install_requires=[], + install_requires=[ + 'paramiko', + 'defusedxml', + 'lxml', + ], # You can just specify the packages manually here if your project is # simple. Or you can use find_packages().
Add paramiko, defuesedxml and lxml as install requirements.
greenbone_ospd
train
py
8b6d4810a7d1acf5f23f639c6124cc8e0f999724
diff --git a/Form/Type/BadgeRuleType.php b/Form/Type/BadgeRuleType.php index <HASH>..<HASH> 100644 --- a/Form/Type/BadgeRuleType.php +++ b/Form/Type/BadgeRuleType.php @@ -68,8 +68,9 @@ class BadgeRuleType extends AbstractType 'twolevelselect', array( 'translation_domain' => 'log', - 'attr' => array('class' => 'input-sm'), - 'choices' => $actionChoices + 'attr' => array('class' => 'input-sm'), + 'choices' => $actionChoices, + 'choices_as_values' => true ) ) ->add('isUserReceiver', 'checkbox')
[BadgeBundle] Compat with sf <I>
claroline_Distribution
train
php
388faa611ae81aba1cc00eb7276997e44dea0b6c
diff --git a/ngDraggable.js b/ngDraggable.js index <HASH>..<HASH> 100644 --- a/ngDraggable.js +++ b/ngDraggable.js @@ -176,6 +176,7 @@ angular.module("ngDraggable", []) evt.preventDefault(); $rootScope.$broadcast('draggable:end', {x:_mx, y:_my, tx:_tx, ty:_ty, event:evt, element:element, data:_data, callback:onDragComplete, uid: _myid}); element.removeClass('dragging'); + element.closest('.drag-enter').removeClass('drag-enter'); reset(); $document.off(_moveEvents, onmove); $document.off(_releaseEvents, onrelease);
fix issue #<I> drag-enter class isn't removed from the dragged element after the drag ends.
fatlinesofcode_ngDraggable
train
js
728b3462d3e04ee8ff0749d1e79d9f5fedf2a1ec
diff --git a/src/Behat/Behat/Formatter/PrettyFormatter.php b/src/Behat/Behat/Formatter/PrettyFormatter.php index <HASH>..<HASH> 100644 --- a/src/Behat/Behat/Formatter/PrettyFormatter.php +++ b/src/Behat/Behat/Formatter/PrettyFormatter.php @@ -703,7 +703,7 @@ class PrettyFormatter extends ProgressFormatter (!$exception instanceof UndefinedException || null === $snippet)) { $this->printStepException($exception, $color); } - if (null !== $snippet) { + if (null !== $snippet && $this->getParameter('snippets')) { $this->printStepSnippet($snippet); } }
print step snippets in HTML formatter only if they are enabled (closes #<I>)
Behat_Behat
train
php
9222d5aec3b2da0bf95fd4039ec34cd0281f7199
diff --git a/pytestsalt/utils.py b/pytestsalt/utils.py index <HASH>..<HASH> 100644 --- a/pytestsalt/utils.py +++ b/pytestsalt/utils.py @@ -15,7 +15,13 @@ from __future__ import absolute_import import socket +# Import 3rd party libs +import pytest +pytest_plugins = ['helpers_namespace'] + + [email protected] def get_unused_localhost_port(): ''' Return a random unused port on localhost
Register `get_unused_localhost_port` as a pytest helper.
saltstack_pytest-salt
train
py
bc8cdb16511756b038cb1fd92ff2230ad268f684
diff --git a/internal/service/codestarconnections/tags_gen.go b/internal/service/codestarconnections/tags_gen.go index <HASH>..<HASH> 100644 --- a/internal/service/codestarconnections/tags_gen.go +++ b/internal/service/codestarconnections/tags_gen.go @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codestarconnections" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) // ListTags lists codestarconnections service tags.
codestarconnections: Fix more import problems
terraform-providers_terraform-provider-aws
train
go
7fc0f71e3603d7e4a8ee733228e67c34d77d12fd
diff --git a/lib/peddler/operation.rb b/lib/peddler/operation.rb index <HASH>..<HASH> 100644 --- a/lib/peddler/operation.rb +++ b/lib/peddler/operation.rb @@ -28,10 +28,8 @@ module Peddler self end - def store(key, val, parent: '') - key = camelize(key) if key.is_a?(Symbol) - key = "#{parent}.#{key}" unless parent.empty? - + def store(key, val, parent: nil) + key = [parent, camelize(key)].compact.join('.') val = val.iso8601 if val.respond_to?(:iso8601) val = val.to_h if val.is_a?(Struct) @@ -51,10 +49,11 @@ module Peddler private - def camelize(sym) - return sym.to_s if sym =~ CAPITAL_LETTERS + def camelize(key) + return key unless key.is_a?(Symbol) + return key.to_s if key =~ CAPITAL_LETTERS - sym + key .to_s .split('_') .map { |token| capitalize(token) }
Refactor Peddler::Operation#store
hakanensari_peddler
train
rb
fdf18029689b548d0c14039f2cedf5501667661f
diff --git a/scripts/benchmark.js b/scripts/benchmark.js index <HASH>..<HASH> 100755 --- a/scripts/benchmark.js +++ b/scripts/benchmark.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +Error.stackTraceLimit = Infinity; const uglify = require('uglify-js'); const Table = require('cli-table'); @@ -10,7 +11,9 @@ const zlib = require('zlib'); const fs = require('fs'); const path = require('path'); -babel.register(); + +require('babel-jest/node_modules/babel-core').register(); + const filename = process.argv[2]; if (!filename) { console.error('Error: No filename specified'); @@ -74,12 +77,6 @@ function test(name, callback) { test('babel', function (code, callback) { return babel.transform(code, { - experimental: true, - whitelist: [], - optional: [ - 'minification.memberExpressionLiterals', - 'minification.propertyLiterals', - ], plugins: [ // 'constant-folding', require('../src/mangle-names-plugin'),
update to run in babel 6
babel_minify
train
js
b6ba24ca5d129f0ee7fdab6354625f2e62b015a4
diff --git a/library/Garp/Model/Db/Faker.php b/library/Garp/Model/Db/Faker.php index <HASH>..<HASH> 100644 --- a/library/Garp/Model/Db/Faker.php +++ b/library/Garp/Model/Db/Faker.php @@ -129,10 +129,10 @@ class Garp_Model_Db_Faker { if ($name === 'name') { return $this->_faker->sentence; } - if ($name === 'first_name') { + if (f\either(f\contains('first_name'), f\contains('voornaam'))($name)) { return $this->_faker->firstName; } - if ($name === 'last_name') { + if (f\either(f\contains('last_name'), f\contains('achternaam'))($name)) { return $this->_faker->lastName; } return $this->_faker->text( @@ -145,3 +145,4 @@ class Garp_Model_Db_Faker { } +
Improve detection of name fields - Check for substrings rather than full matches, to pick up columns where first/last names are prefixed or suffixed. - Also, pick up on Dutch column names.
grrr-amsterdam_garp3
train
php
001597c723937554d161b3dcd24361125561a317
diff --git a/h2o-core/src/test/java/water/fvec/WordCountBigTest.java b/h2o-core/src/test/java/water/fvec/WordCountBigTest.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/test/java/water/fvec/WordCountBigTest.java +++ b/h2o-core/src/test/java/water/fvec/WordCountBigTest.java @@ -14,4 +14,8 @@ public class WordCountBigTest extends WordCountTest { if( file==null ) throw new FileNotFoundException(best); doWordCount(file); } + + @Test public void testWordCount() throws IOException { + // Do nothing; in particular, don't run inherited testWordCount again. + } }
Don't run inherited testWordCount.
h2oai_h2o-3
train
java
7109d42bf768fde4e196b6c3b15cdd3e1771e4d1
diff --git a/lib/class.OS_Windows.php b/lib/class.OS_Windows.php index <HASH>..<HASH> 100644 --- a/lib/class.OS_Windows.php +++ b/lib/class.OS_Windows.php @@ -170,14 +170,14 @@ class OS_Windows { $cpus = array(); $alt = false; - $object = $this->wmi->ExecQuery("SELECT Name, Manufacturer, CurrentClockSpeed, NumberOfLogicalProcessors FROM Win32_Processor"; + $object = $this->wmi->ExecQuery("SELECT Name, Manufacturer, CurrentClockSpeed, NumberOfLogicalProcessors FROM Win32_Processor"); if (!is_object($object)) { - $object = $this->wmi->ExecQuery("SELECT Name, Manufacturer, CurrentClockSpeed FROM Win32_Processor"; + $object = $this->wmi->ExecQuery("SELECT Name, Manufacturer, CurrentClockSpeed FROM Win32_Processor"); $alt = true; } - foreach($objectas $cpu) { + foreach($object as $cpu) { $curr = array( 'Model' => $cpu->Name, 'Vendor' => $cpu->Manufacturer,
Fixed listing CPUs (again)
jrgp_linfo
train
php
bbb9dc98f189d924a49c4323fbc0bd225e41c022
diff --git a/test/integration/generated_regress_test.rb b/test/integration/generated_regress_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/generated_regress_test.rb +++ b/test/integration/generated_regress_test.rb @@ -821,6 +821,7 @@ describe Regress, "The generated Regress module" do it "has a correct #test_date_in_gvalue function" do r = Regress.test_date_in_gvalue date = r.ruby_value + skip unless date.respond_to? :get_year assert_equal [1984, :december, 5], [date.get_year, date.get_month, date.get_day] end
Skip test involving GDate if introspection data is incomplete.
mvz_gir_ffi
train
rb
515fed77bda5f318ad6436bea4ad4391e00cd9ef
diff --git a/test/server.test.js b/test/server.test.js index <HASH>..<HASH> 100644 --- a/test/server.test.js +++ b/test/server.test.js @@ -1927,3 +1927,18 @@ test('GH-877 content-type should be case insensitive', function (t) { }); client.end(); }); + +test('GH-882: route name is same as specified', function (t) { + SERVER.get({ + name: 'my-r$-%-x', + path: '/m1' + }, function (req, res, next) { + res.send({name: req.route.name}); + }); + + CLIENT.get('/m1', function (err, _, res) { + t.ifError(err); + t.equal(res.body, '{"name":"my-r$-%-x"}'); + t.end(); + }); +});
adding test to ensure route name is same as specified
restify_plugins
train
js
5dcbcaa82cc018dc99070c6bc39a411a7f9749f3
diff --git a/trakt/interfaces/sync/__init__.py b/trakt/interfaces/sync/__init__.py index <HASH>..<HASH> 100644 --- a/trakt/interfaces/sync/__init__.py +++ b/trakt/interfaces/sync/__init__.py @@ -20,9 +20,10 @@ __all__ = [ class SyncInterface(Interface): path = 'sync' - def last_activities(self): + def last_activities(self, **kwargs): return self.get_data( - self.http.get('lastactivities') + self.http.get('last_activities'), + **kwargs ) def playback(self):
Fixed [/sync] last_activities() method and pass **kwargs to get_data()
fuzeman_trakt.py
train
py
bdd32024c511040c40af95850aa6db29b86b806a
diff --git a/tests/MainClassTest.php b/tests/MainClassTest.php index <HASH>..<HASH> 100644 --- a/tests/MainClassTest.php +++ b/tests/MainClassTest.php @@ -175,7 +175,7 @@ class MainClassTest extends \PHPUnit\Framework\TestCase $supportsLang = $deepLy->supportsLangCode($langCode); - $this->assertEquals('true', $supportsLang); + $this->assertEquals(true, $supportsLang); } public function testGetLangName()
Bugfix (wrong type of var)
chriskonnertz_DeepLy
train
php
42f0c96b174d434e3ffa5ae1b737dbb8120e1f28
diff --git a/lib/fabrication/generator/base.rb b/lib/fabrication/generator/base.rb index <HASH>..<HASH> 100644 --- a/lib/fabrication/generator/base.rb +++ b/lib/fabrication/generator/base.rb @@ -56,7 +56,7 @@ class Fabrication::Generator::Base assign(method_name, options, &block) end else - assign(method_name, args.first) + assign(method_name, {}, args.first) end end @@ -68,13 +68,13 @@ class Fabrication::Generator::Base instance.save! if options[:save] && instance.respond_to?(:save!) end - def assign(method_name, param) - if param.is_a?(Hash) && param.has_key?(:count) - value = (1..param[:count]).map do |i| - block_given? ? yield(instance, i) : param + def assign(method_name, options, raw_value=nil) + if options.has_key?(:count) + value = (1..options[:count]).map do |i| + block_given? ? yield(instance, i) : raw_value end else - value = block_given? ? yield(instance) : param + value = block_given? ? yield(instance) : raw_value end instance.send("#{method_name}=", value) end
Reduce guesswork in Base#assign
paulelliott_fabrication
train
rb
34b94de459207cf628d29bf4148c30a63222cb4f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,16 @@ module.exports = { output: { file: 'spin.js', format: 'es' - } + }, + onwarn: function(warning) { + // Suppress known error message caused by TypeScript compiled code with Rollup + // https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined + if (warning.code === 'THIS_IS_UNDEFINED') { + return; + } + // eslint-disable-next-line no-console + console.log("Rollup warning: ", warning.message); + }, } });
Suppress rollup warning (#<I>)
kiwiupover_ember-cli-spinjs
train
js
37663d5cabb0b9a33de40b5d7a6032ab595dbfc2
diff --git a/ratcave/shader.py b/ratcave/shader.py index <HASH>..<HASH> 100644 --- a/ratcave/shader.py +++ b/ratcave/shader.py @@ -139,6 +139,4 @@ class Shader(ugl.BindingContextMixin, ugl.BindNoTargetMixin): # obtain the uniform location if not loc: loc = self.get_uniform_location(name) - gl.glUniformMatrix4fv(loc, 1, False, (c_float * 16)(*mat.ravel('F'))) # uplaod the 4x4 floating point matrix - # cmat = mat.T.ctypes.data_as(POINTER(c_float * 16)).contents - # gl.glUniformMatrix4fv(loc, 1, False, cmat) # uplaod the 4x4 floating point matrix + gl.glUniformMatrix4fv(loc, 1, True, (c_float * 16)(*mat.ravel())) # uplaod the 4x4 floating point matrix
Performed transpose directly in OpenGL function.
ratcave_ratcave
train
py
8295c3058a40e9d553c6aeff4e68fcaaba62586a
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,8 +5,8 @@ from pallets_sphinx_themes import ProjectLink project = 'Flask-JSONRPC' copyright = '2021, Nycholas de Oliveira e Oliveira' # pylint: disable=W0622 author = 'Nycholas de Oliveira e Oliveira' -release = '2.1.0.beta' -version = '2.1.0.beta' +release = '2.1.0' +version = '2.1.0' # -- General configuration --------------------------------------------------- diff --git a/src/flask_jsonrpc/__init__.py b/src/flask_jsonrpc/__init__.py index <HASH>..<HASH> 100644 --- a/src/flask_jsonrpc/__init__.py +++ b/src/flask_jsonrpc/__init__.py @@ -28,4 +28,4 @@ from .app import JSONRPC from .views import JSONRPCView from .blueprints import JSONRPCBlueprint -__version__ = '2.1.0.beta' +__version__ = '2.1.0'
Version <I> * Restructures the project (#<I>) * Add dependabot.yml * Add support to async and await * Add badge docs * Add FUNDING.yml * Unindent & highlight code sections (#<I>)
cenobites_flask-jsonrpc
train
py,py
cff2e5ed72156478baeee19ce56e50880fb60158
diff --git a/bcbio/ngsalign/tophat.py b/bcbio/ngsalign/tophat.py index <HASH>..<HASH> 100644 --- a/bcbio/ngsalign/tophat.py +++ b/bcbio/ngsalign/tophat.py @@ -42,7 +42,8 @@ def align(fastq_file, pair_file, ref_file, out_base, align_dir, config): with file_transaction([os.path.join(out_dir, f) for f in _out_fnames]): child = subprocess.check_call(cl) out_file_final = os.path.join(out_dir, "%s.sam" % out_base) - os.symlink(out_file, out_file_final) + if not os.path.exists(out_file_final): + os.symlink(out_file, out_file_final) return out_file_final def _estimate_paired_innerdist(fastq_file, pair_file, ref_file, out_base,
Avoid symlinking tophat output file if previously exists
bcbio_bcbio-nextgen
train
py
63213fe498cca9a550ff8ab1c1ee6f2f7a4aa9ae
diff --git a/cypress/component/basic/network/users-spec.js b/cypress/component/basic/network/users-spec.js index <HASH>..<HASH> 100644 --- a/cypress/component/basic/network/users-spec.js +++ b/cypress/component/basic/network/users-spec.js @@ -10,7 +10,7 @@ context('Users', () => { it('fetches 3 users from remote API', () => { mount(<Users />) // fetching users can take a while - cy.get('li', { timeout: 20000 }).should('have.length', 3) + cy.get('li', { timeout: 60000 }).should('have.length', 3) }) })
increase wait for command for bahmutov/cypress-react-unit-test#<I>
cypress-io_cypress
train
js