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
6f7dbdb5a5a5cfa628cf5adc16fb81c1753388bc
diff --git a/src/Common/Model/Base.php b/src/Common/Model/Base.php index <HASH>..<HASH> 100644 --- a/src/Common/Model/Base.php +++ b/src/Common/Model/Base.php @@ -577,6 +577,14 @@ abstract class Base */ public function getAllRawQuery($iPage = null, $iPerPage = null, $aData = [], $bIncludeDeleted = false) { + // If the first value is an array then treat as if called with getAll(null, null, $aData); + if (is_array($iPage)) { + $aData = $iPage; + $iPage = null; + } + + // -------------------------------------------------------------------------- + $oDb = Factory::service('Database'); $sTable = $this->getTableName(true);
Adding support for “first param as an array” for calls to `getAllRawQuery()`, too.
nails_common
train
php
12298d599b8cd24d2b80f9ae6e77a2a5ce274698
diff --git a/lib/Predis.php b/lib/Predis.php index <HASH>..<HASH> 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -2572,6 +2572,16 @@ class ZSetReverseRange extends \Predis\Commands\ZSetRange { class ZSetRangeByScore extends \Predis\Commands\ZSetRange { public function getCommandId() { return 'ZRANGEBYSCORE'; } + protected function prepareOptions($options) { + $opts = array_change_key_case($options, CASE_UPPER); + $finalizedOpts = array(); + if (isset($opts['LIMIT']) && is_array($opts['LIMIT'])) { + $finalizedOpts[] = 'LIMIT'; + $finalizedOpts[] = $opts['LIMIT'][0]; + $finalizedOpts[] = $opts['LIMIT'][1]; + } + return array_merge($finalizedOpts, parent::prepareOptions($options)); + } } class ZSetCount extends \Predis\MultiBulkCommand {
Add support for the LIMIT modifier in ZRANGEBYSCORE.
imcj_predis
train
php
52b5a1a2c6257af941a46289c1a308df7200ad50
diff --git a/docroot/themes/custom/ymca/scripts/ymca.js b/docroot/themes/custom/ymca/scripts/ymca.js index <HASH>..<HASH> 100644 --- a/docroot/themes/custom/ymca/scripts/ymca.js +++ b/docroot/themes/custom/ymca/scripts/ymca.js @@ -11,13 +11,16 @@ if (hash && !this.attached) { window.setTimeout(function() { var menuHeight = $('.top-navs').height(); - if (menuHeight == 0) { + var top = $(hash).offset().top; + if ($('.top-navs').height() == 0) { // For mobile state. - menuHeight = $('.nav-global').height(); + $(document).scrollTop(top - 52); } - var yOffset = $(hash).offset().top - menuHeight - 10; - $(document).scrollTop(yOffset); - }, 1000); + else { + // Destop mode. + $(document).scrollTop(top - 113); + } + }, 100); this.attached = true; } }
YPTF-<I>: Some corrections.
ymcatwincities_openy
train
js
91aebc758cd4c1a4384c5b047f1ebc8e3f7d860e
diff --git a/test/router.test.js b/test/router.test.js index <HASH>..<HASH> 100644 --- a/test/router.test.js +++ b/test/router.test.js @@ -74,6 +74,34 @@ module.exports = { }); }, + 'test app.param(fn)': function(){ + var app = express.createServer(); + + app.param(function(name, fn){ + if (fn instanceof RegExp) { + return function(req, res, next, val){ + var captures; + if (captures = fn.exec(String(val))) { + req.params[name] = captures[1]; + next(); + } else { + next('route'); + } + } + } + }); + + app.param('commit', /^(\d+)$/); + + app.get('/commit/:commit', function(req, res){ + res.send(req.params.commit); + }); + + assert.response(app, + { url: '/commit/12' }, + { body: '12' }); + }, + 'test precedence': function(){ var app = express.createServer();
Added test for `app.param(fn)`
expressjs_express
train
js
124669c4e10f45a5f1a832dd26eca96fd7887dbb
diff --git a/scss/src/build.py b/scss/src/build.py index <HASH>..<HASH> 100755 --- a/scss/src/build.py +++ b/scss/src/build.py @@ -4,22 +4,25 @@ from distutils.core import setup, Extension from distutils.command.build_ext import build_ext as _build_ext import os + abspath = os.path.abspath(__file__) dname = os.path.dirname(abspath) os.chdir(dname) + class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_options(self) self.build_temp = './' - self.build_lib = '../' + self.build_lib = '../grammar/' + if len(sys.argv) == 1: sys.argv.append('build') setup(ext_modules=[ Extension( - '_speedups', + '_scanner', sources=['_speedups.c', 'block_locator.c', 'scanner.c'], libraries=['pcre'], ),
Speedups builder fixes speedup building path
Kronuz_pyScss
train
py
0f090224cabd6da0be05d9b8d500a53d9afc58b5
diff --git a/lib/requester/browser/request.js b/lib/requester/browser/request.js index <HASH>..<HASH> 100644 --- a/lib/requester/browser/request.js +++ b/lib/requester/browser/request.js @@ -243,9 +243,19 @@ function run_xhr(options) { request.log.debug('State change', {'state':xhr.readyState, 'id':xhr.id, 'timed_out':timed_out}) if(xhr.readyState === XHR.OPENED) { - request.log.debug('Request started', {'id':xhr.id}) - for (var key in options.headers) - xhr.setRequestHeader(key, options.headers[key]) + request.log.debug('Request started', { 'id': xhr.id }); + for (var key in options.headers) { + if (options.headers.hasOwnProperty(key)) { + if (Array.isArray(options.headers[key])) { + _.each(options.headers[key], function (eachValue) { + xhr.setRequestHeader(key, eachValue); + }); + } + else { + xhr.setRequestHeader(key, options.headers[key]); + } + } + } } else if(xhr.readyState === XHR.HEADERS_RECEIVED)
allow setting multiple headers in the browser as well
postmanlabs_postman-runtime
train
js
1a3230a003d6bc84cf93059b9b2b056e72128f64
diff --git a/eventsourcing/tests/djangoproject/djangoproject/settings.py b/eventsourcing/tests/djangoproject/djangoproject/settings.py index <HASH>..<HASH> 100644 --- a/eventsourcing/tests/djangoproject/djangoproject/settings.py +++ b/eventsourcing/tests/djangoproject/djangoproject/settings.py @@ -79,6 +79,15 @@ WSGI_APPLICATION = 'djangoproject.wsgi.application' # and Docker compose makes it easy to use one MySQL database but using # more than one adds complications, so use PostgreSQL for all Django tests, # despite relative slow performance. + + +try: + from psycopg2cffi import compat + compat.register() +except ImportError: + pass + + DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2',
Trying to get psycopg2cffi working with pypy3...
johnbywater_eventsourcing
train
py
229718e2e0074d594ee10a61311eef7a424514fb
diff --git a/lib/desi/runner.rb b/lib/desi/runner.rb index <HASH>..<HASH> 100644 --- a/lib/desi/runner.rb +++ b/lib/desi/runner.rb @@ -107,6 +107,10 @@ module Desi else index_manager.list(pattern) end + + rescue Errno::ECONNREFUSED + warn "Server #{options[:host]} appears to be unavailable!" + exit 1 end desc "Show tail output from Elastic Search's log file"
CLI: provide a nicer error when listing indices for a unreachable host Having a proper error message is nicer than barfing up an exception. I wonder what would be the nicest way to handle this from a library user POV, though. :question:
af83_desi
train
rb
4309b91ab9d9372b47df0286142d1f03ae8a236e
diff --git a/src/Api.php b/src/Api.php index <HASH>..<HASH> 100644 --- a/src/Api.php +++ b/src/Api.php @@ -223,7 +223,7 @@ namespace Cloudinary { $type = \Cloudinary::option_get($options, "type", "upload"); $uri = ["resources", $resource_type, $type]; $params = [ - "public_ids" => $public_ids, + "public_ids" => \Cloudinary::build_array($public_ids), "keep_original" => true, ]; if (is_array($transformations)) { diff --git a/tests/ApiTest.php b/tests/ApiTest.php index <HASH>..<HASH> 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -322,7 +322,7 @@ namespace Cloudinary { $public_id = "public_id"; $transformations = "c_crop,w_100"; Curl::mockApi($this); - $this->api->delete_derived_by_transformation(array($public_id), $transformations); + $this->api->delete_derived_by_transformation($public_id, $transformations); assertUrl($this, "/resources/image/upload"); assertDelete($this); assertParam($this, "keep_original", true);
Support string $public_ids parameter in delete_derived_by_transformation
cloudinary_cloudinary_php
train
php,php
184fe27ce94c74b72269e625adfbec4d3584ffd2
diff --git a/__tests__/src/rules/has-valid-accessibility-state-test.js b/__tests__/src/rules/has-valid-accessibility-state-test.js index <HASH>..<HASH> 100644 --- a/__tests__/src/rules/has-valid-accessibility-state-test.js +++ b/__tests__/src/rules/has-valid-accessibility-state-test.js @@ -91,6 +91,12 @@ ruleTester.run('has-valid-accessibility-state', rule, { accessibilityState={accessibilityState} />`, }, + { + code: `<TouchableOpacity + {...localProps} + accessibilityState={accessibilityState} + />`, + }, ].map(parserOptionsMapper), invalid: [ { diff --git a/src/rules/has-valid-accessibility-state.js b/src/rules/has-valid-accessibility-state.js index <HASH>..<HASH> 100644 --- a/src/rules/has-valid-accessibility-state.js +++ b/src/rules/has-valid-accessibility-state.js @@ -29,7 +29,7 @@ module.exports = { if (hasProp(node.attributes, PROP_NAME)) { const stateProp = node.attributes.find( // $FlowFixMe - (f) => f.name.name === PROP_NAME + (f) => f.name?.name === PROP_NAME ); const statePropType = // $FlowFixMe
support spread props in has-accessibility-state (#<I>)
FormidableLabs_eslint-plugin-react-native-a11y
train
js,js
91070ee9330814f41af7dc821403c8663d1dc54c
diff --git a/seleniumbase/console_scripts/sb_install.py b/seleniumbase/console_scripts/sb_install.py index <HASH>..<HASH> 100755 --- a/seleniumbase/console_scripts/sb_install.py +++ b/seleniumbase/console_scripts/sb_install.py @@ -113,10 +113,8 @@ def main(override=None): num_args = len(sys.argv) if ( - sys.argv[0].split("/")[-1].lower() == "seleniumbase" - or (sys.argv[0].split("\\")[-1].lower() == "seleniumbase") - or (sys.argv[0].split("/")[-1].lower() == "sbase") - or (sys.argv[0].split("\\")[-1].lower() == "sbase") + "sbase" in sys.argv[0].lower() + or ("seleniumbase" in sys.argv[0].lower()) ): if num_args < 3 or num_args > 5: invalid_run_command()
Fix issue with driver install on Windows <I>
seleniumbase_SeleniumBase
train
py
32b43bc21a053cbe566feefd3c54def739d40bfe
diff --git a/cli/command/swarm/ca.go b/cli/command/swarm/ca.go index <HASH>..<HASH> 100644 --- a/cli/command/swarm/ca.go +++ b/cli/command/swarm/ca.go @@ -61,6 +61,11 @@ func runRotateCA(dockerCli command.Cli, flags *pflag.FlagSet, opts caOptions) er } if !opts.rotate { + for _, f := range []string{flagCACert, flagCAKey, flagCACert, flagExternalCA} { + if flags.Changed(f) { + return fmt.Errorf("`--%s` flag requires the `--rotate` flag to update the CA", f) + } + } if swarmInspect.ClusterInfo.TLSInfo.TrustRoot == "" { fmt.Fprintln(dockerCli.Out(), "No CA information available") } else { @@ -71,7 +76,7 @@ func runRotateCA(dockerCli command.Cli, flags *pflag.FlagSet, opts caOptions) er genRootCA := true spec := &swarmInspect.Spec - opts.mergeSwarmSpec(spec, flags) + opts.mergeSwarmSpec(spec, flags) // updates the spec given the cert expiry or external CA flag if flags.Changed(flagCACert) { spec.CAConfig.SigningCACert = opts.rootCACert.Contents() genRootCA = false
If `docker swarm ca` is not called with the `--rotate` flag, the other flags, including cert expiry, will be ignored, so warn if a user attempts to use `docker swarm ca --cert-expiry` or something.
docker_cli
train
go
473e3da4458485a1e1a60025221cf86798ebea15
diff --git a/addon/mixins/paginated-route.js b/addon/mixins/paginated-route.js index <HASH>..<HASH> 100644 --- a/addon/mixins/paginated-route.js +++ b/addon/mixins/paginated-route.js @@ -16,7 +16,13 @@ export default Ember.Mixin.create({ pageArg: 'page', pageSizeArg: 'page[size]', - /* Convenience method. Given a model name (and optional user params), fetch a page of records. */ + /** + * @method queryForPage Fetch a route-specifed page of results from an external API + * @param modelName The name of the model to query in the store + * @param routeParams Parameters gictionary available to the model hook; must be passed in manually + * @param userParams Additional user-specified query parameters + * @returns {Promise} + */ queryForPage(modelName, routeParams, userParams) { let params = Object.assign({}, userParams || {}, routeParams); // If page_size is present, rename the url arg to to whatever URL param name the API server expects
Function docstring Ember convention defaults to YUIDoc, same as COSDev. <URL>
CenterForOpenScience_ember-osf
train
js
7a94add5efc868d16e1d71f751db63c41e6e4549
diff --git a/test/slugged_test.rb b/test/slugged_test.rb index <HASH>..<HASH> 100644 --- a/test/slugged_test.rb +++ b/test/slugged_test.rb @@ -100,6 +100,15 @@ class SlugGeneratorTest < MiniTest::Unit::TestCase end end + test "should correctly sequence slugs that end with numbers" do + transaction do + record1 = model_class.create! :name => "Peugeuot 206" + assert_equal "peugeuot-206", record1.slug + record2 = model_class.create! :name => "Peugeuot 206" + assert_equal "peugeuot-206--2", record2.slug + end + end + end class SlugSeparatorTest < MiniTest::Unit::TestCase
Add tests for slugs ending with numbers.
norman_friendly_id
train
rb
fe17e49fc4d6abd22ae7255b409752105190383b
diff --git a/src/video/canvas/canvas_renderer.js b/src/video/canvas/canvas_renderer.js index <HASH>..<HASH> 100644 --- a/src/video/canvas/canvas_renderer.js +++ b/src/video/canvas/canvas_renderer.js @@ -570,8 +570,8 @@ a[1], a[3], a[4], - a[6], - a[7] + ~(0.5 + a[6]), + ~(0.5 + a[7]) ); },
[#<I>] make sure we use integer values for tx/ty when using transform not sure where is the webgl equivalent though...
melonjs_melonJS
train
js
a37c458a8b5262e0ea73d4bf55908954789e3592
diff --git a/scriptworker/test/test_integration.py b/scriptworker/test/test_integration.py index <HASH>..<HASH> 100644 --- a/scriptworker/test/test_integration.py +++ b/scriptworker/test/test_integration.py @@ -352,12 +352,12 @@ async def test_temp_creds(context_function): "index": "gecko.v2.mozilla-central.nightly.latest.firefox.win64-nightly-repackage-signing", "task_type": "signing", }, { - "name": "mozilla-beta linux64 en-US repackage signing", - "index": "gecko.v2.mozilla-beta.nightly.latest.firefox.linux64-nightly-repackage-signing", + "name": "mozilla-beta win64 en-US repackage signing", + "index": "gecko.v2.mozilla-beta.nightly.latest.firefox.win64-nightly-repackage-signing", "task_type": "signing", }, { - "name": "mozilla-release linux64 en-US repackage signing", - "index": "gecko.v2.mozilla-release.nightly.latest.firefox.linux64-nightly-repackage-signing", + "name": "mozilla-release win64 en-US repackage signing", + "index": "gecko.v2.mozilla-release.nightly.latest.firefox.win64-nightly-repackage-signing", "task_type": "signing", })) @pytest.mark.asyncio
fix integration tests - win<I> repackage-signing on beta+release
mozilla-releng_scriptworker
train
py
3fb0889333ea7504516e480be8d2f286e07c7394
diff --git a/lib/puppet-lint.rb b/lib/puppet-lint.rb index <HASH>..<HASH> 100644 --- a/lib/puppet-lint.rb +++ b/lib/puppet-lint.rb @@ -36,7 +36,7 @@ class PuppetLint def file=(path) if File.exist? path - @path = path + @path = File.expand_path(path) @data = File.read(path) end end
Pass the full path through to the check plugins
rodjek_puppet-lint
train
rb
04de5986618f9fafb1d3cd31717477e78cdf2020
diff --git a/workbench/workers/rekall_adapter/rekall_adapter.py b/workbench/workers/rekall_adapter/rekall_adapter.py index <HASH>..<HASH> 100644 --- a/workbench/workers/rekall_adapter/rekall_adapter.py +++ b/workbench/workers/rekall_adapter/rekall_adapter.py @@ -5,7 +5,7 @@ """ -import os +import os, sys import logging from rekall import session from rekall.plugins.addrspaces import standard @@ -182,7 +182,6 @@ class WorkbenchRenderer(BaseRenderer): """This method starts the plugin, calls render and returns the plugin output """ gsleep() self.start(plugin_name=plugin.name) - gsleep() plugin.render(self) gsleep() return self.output_data @@ -240,8 +239,7 @@ def test(): # Did we properly download the memory file? if not os.path.isfile(data_path): print 'Could not open exemplar4.vmem' - exit(1) - + sys.exit(1) # Got the file, now process it raw_bytes = open(data_path, 'rb').read()
removing another probably misplaced gsleep
SuperCowPowers_workbench
train
py
d030bc0b95fe19449c02683ffa759e516149e11d
diff --git a/OpenPNM/Base/__Tools__.py b/OpenPNM/Base/__Tools__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Base/__Tools__.py +++ b/OpenPNM/Base/__Tools__.py @@ -98,7 +98,7 @@ class SetLocations(): def add(obj, element, locations): net = obj._net element = obj._parse_element(element, single=True) - locations = obj._parse_locations(locations) + locations = net._parse_locations(locations) # Adapt the method depending on type of object received if obj._isa('Physics'):
The set_locations receives pores and throats for the Network, so the _parse_locations check in SetLocations should use net._parse_locations, not geom._parse_locations.
PMEAL_OpenPNM
train
py
49ffbf8d5d3efaa4a795c98b371df97376a5ddaa
diff --git a/src/main/java/org/mockito/internal/stubbing/StubbingComparator.java b/src/main/java/org/mockito/internal/stubbing/StubbingComparator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/mockito/internal/stubbing/StubbingComparator.java +++ b/src/main/java/org/mockito/internal/stubbing/StubbingComparator.java @@ -6,10 +6,13 @@ import org.mockito.stubbing.Stubbing; import java.util.Comparator; /** - * Compares stubbings based on sequence number + * Compares stubbings based on {@link InvocationComparator} */ public class StubbingComparator implements Comparator<Stubbing> { + + private final InvocationComparator invocationComparator = new InvocationComparator(); + public int compare(Stubbing o1, Stubbing o2) { - return new InvocationComparator().compare(o1.getInvocation(), o2.getInvocation()); + return invocationComparator.compare(o1.getInvocation(), o2.getInvocation()); } }
Minor refactoring based on feedback
mockito_mockito
train
java
375f599dfd96f69ff33e9fdb0302b99a7c0d90b1
diff --git a/spec/git_fame_spec.rb b/spec/git_fame_spec.rb index <HASH>..<HASH> 100644 --- a/spec/git_fame_spec.rb +++ b/spec/git_fame_spec.rb @@ -185,7 +185,7 @@ describe GitFame::Base do repository: @repository, since:"2100-01-01" }) - since.files.should eq(16) + since.files.should eq(0) since.commits.should eq(0) since.loc.should eq(0) end @@ -197,7 +197,7 @@ describe GitFame::Base do repository: @repository, until:"1972-01-01" }) - since.files.should eq(16) + since.files.should eq(0) since.commits.should eq(0) since.loc.should eq(0) end @@ -212,7 +212,7 @@ describe GitFame::Base do describe "summary" do it "should ignore all files after until " do since.pretty_puts - since.files.should eq(16) + since.files.should eq(15) since.commits.should eq(22) since.loc.should eq(135) end
correct expectations as file count is now correct for timeshot
oleander_git-fame-rb
train
rb
83fd92627cc9834ceccb85544b1fab7bf52150a0
diff --git a/viper.go b/viper.go index <HASH>..<HASH> 100644 --- a/viper.go +++ b/viper.go @@ -262,6 +262,14 @@ func IsSet(key string) bool { return t != nil } +// Have viper check ENV variables for all +// keys set in config, default & flags +func AutomaticEnv() { + for _, x := range AllKeys() { + BindEnv(x) + } +} + // Aliases provide another accessor for the same key. // This enables one to change a name without breaking the application func RegisterAlias(alias string, key string) { diff --git a/viper_test.go b/viper_test.go index <HASH>..<HASH> 100644 --- a/viper_test.go +++ b/viper_test.go @@ -135,9 +135,15 @@ func TestEnv(t *testing.T) { os.Setenv("ID", "13") os.Setenv("FOOD", "apple") + os.Setenv("NAME", "crunk") assert.Equal(t, "13", Get("id")) assert.Equal(t, "apple", Get("f")) + assert.Equal(t, "Cake", Get("name")) + + AutomaticEnv() + + assert.Equal(t, "crunk", Get("name")) } func TestAllKeys(t *testing.T) {
Adding automatic reading from ENV w/tests
spf13_viper
train
go,go
5ca3b61609fee5c3a0d4cab19ad0fb5aabd67a4f
diff --git a/docs/storage/driver/gcs/gcs.go b/docs/storage/driver/gcs/gcs.go index <HASH>..<HASH> 100644 --- a/docs/storage/driver/gcs/gcs.go +++ b/docs/storage/driver/gcs/gcs.go @@ -482,7 +482,7 @@ func (d *driver) Move(context ctx.Context, sourcePath string, destPath string) e return err } err = storageDeleteObject(gcsContext, d.bucket, d.pathToKey(sourcePath)) - // if deleting the file fails, log the error, but do not fail; the file was succesfully copied, + // if deleting the file fails, log the error, but do not fail; the file was successfully copied, // and the original should eventually be cleaned when purging the uploads folder. if err != nil { logrus.Infof("error deleting file: %v due to %v", sourcePath, err)
Fix two misspellings in source code comments
docker_distribution
train
go
7ea75ef4a92e64948f100013fd9dcf5913489af0
diff --git a/cmd/ctr/commands/tasks/metrics.go b/cmd/ctr/commands/tasks/metrics.go index <HASH>..<HASH> 100644 --- a/cmd/ctr/commands/tasks/metrics.go +++ b/cmd/ctr/commands/tasks/metrics.go @@ -90,9 +90,12 @@ var metricsCommand = cli.Command{ fmt.Fprintf(w, "METRIC\tVALUE\t\n") fmt.Fprintf(w, "memory.usage_in_bytes\t%d\t\n", data.Memory.Usage.Usage) + fmt.Fprintf(w, "memory.limit_in_bytes\t%d\t\n", data.Memory.Usage.Limit) fmt.Fprintf(w, "memory.stat.cache\t%d\t\n", data.Memory.TotalCache) fmt.Fprintf(w, "cpuacct.usage\t%d\t\n", data.CPU.Usage.Total) fmt.Fprintf(w, "cpuacct.usage_percpu\t%v\t\n", data.CPU.Usage.PerCPU) + fmt.Fprintf(w, "pids.current\t%v\t\n", data.Pids.Current) + fmt.Fprintf(w, "pids.limit\t%v\t\n", data.Pids.Limit) return w.Flush() case formatJSON: marshaledJSON, err := json.MarshalIndent(data, "", " ")
ctr: add some metric item add memory limit, pid info into metric subcommand, since moby also show them. As blkio read/write IO need more calculation,not add them.
containerd_containerd
train
go
b0824e0d063d9254523a0ca8a4f91550cf77d84c
diff --git a/js/core/Bindable.js b/js/core/Bindable.js index <HASH>..<HASH> 100644 --- a/js/core/Bindable.js +++ b/js/core/Bindable.js @@ -180,7 +180,15 @@ define(["js/core/EventDispatcher", "js/lib/parser", "js/core/Binding","underscor base = this.base; while (base) { - _.defaults(ret, base[property]); + var baseValue = base[property]; + for (var key in baseValue) { + if (baseValue.hasOwnProperty(key)) { + if (_.isUndefined(ret[key])) { + ret[key] = baseValue[key]; + } + } + } + base = base.base; }
fixed generateDefaultChain to see null as value
rappid_rAppid.js
train
js
8b32b8db747e20b81e623b38bbbb25b5cea70fa9
diff --git a/config/src/main/java/org/springframework/security/config/web/server/HttpSecurity.java b/config/src/main/java/org/springframework/security/config/web/server/HttpSecurity.java index <HASH>..<HASH> 100644 --- a/config/src/main/java/org/springframework/security/config/web/server/HttpSecurity.java +++ b/config/src/main/java/org/springframework/security/config/web/server/HttpSecurity.java @@ -454,7 +454,7 @@ public class HttpSecurity { return new HstsSpec(); } - public HttpHeaderWriterWebFilter build() { + protected HttpHeaderWriterWebFilter build() { HttpHeadersWriter writer = new CompositeHttpHeadersWriter(this.writers); return new HttpHeaderWriterWebFilter(writer); }
Polish HeadersBuilder build is protected
spring-projects_spring-security
train
java
0af8dbb554054c2a74839f2f2a7b333f0b033c4b
diff --git a/library/src/org/onepf/oms/OpenIabHelper.java b/library/src/org/onepf/oms/OpenIabHelper.java index <HASH>..<HASH> 100644 --- a/library/src/org/onepf/oms/OpenIabHelper.java +++ b/library/src/org/onepf/oms/OpenIabHelper.java @@ -728,7 +728,7 @@ public class OpenIabHelper { } final CountDownLatch storesToCheck = new CountDownLatch(infoList.size()); for (ResolveInfo info : infoList) { - String packageName = info.serviceInfo.packageName; + final String packageName = info.serviceInfo.packageName; String name = info.serviceInfo.name; Intent intentAppstore = new Intent(intentAppstoreServices); intentAppstore.setClassName(packageName, name); @@ -750,6 +750,7 @@ public class OpenIabHelper { // don't connect to OpenStore if no key provided and verification is strict Log.e(TAG, "discoverOpenStores() verification is required but publicKey is not provided: " + name); } else { + billingIntent.setPackage(packageName); String publicKey = options.getStoreKey(appstoreName); if (options.verifyMode == Options.VERIFY_SKIP) publicKey = null; final OpenAppstore openAppstore = new OpenAppstore(context, appstoreName, openAppstoreService, billingIntent, publicKey, this);
If several store use the same billing intent, not specifying the precise name, a wrong service can be called
onepf_OpenIAB
train
java
f8629ab8ff5742620a16530776091bf3fdf0e78a
diff --git a/bash_kernel.py b/bash_kernel.py index <HASH>..<HASH> 100644 --- a/bash_kernel.py +++ b/bash_kernel.py @@ -86,7 +86,7 @@ class BashKernel(Kernel): # check for valid function name if not re.match('\A[a-zA-Z_]', token): return - start = cursor_pos - len(code) + start = cursor_pos - len(token) cmd = 'compgen -c %s' % token output = self.bashwrapper.run_command(cmd).rstrip() return {'matches': output.split(), 'cursor_start': start,
Use length of token not len of code for start_pos
bgschiller_postgres_kernel
train
py
0cc03ce3d280b0e3caf12ab92c28c753ae2993bf
diff --git a/mstate/watcher.go b/mstate/watcher.go index <HASH>..<HASH> 100644 --- a/mstate/watcher.go +++ b/mstate/watcher.go @@ -133,7 +133,7 @@ func (w *MachinesWatcher) Stop() error { return w.tomb.Wait() } -func (w *MachinesWatcher) appendChange(changes *MachinesChange, ch watcher.Change) (err error) { +func (w *MachinesWatcher) mergeChange(changes *MachinesChange, ch watcher.Change) (err error) { id := ch.Id.(int) if m, ok := w.knownMachines[id]; ch.Revno == -1 && ok { m.doc.Life = Dead @@ -193,7 +193,7 @@ func (w *MachinesWatcher) loop() (err error) { return tomb.ErrDying case c := <-ch: changes = &MachinesChange{} - err := w.appendChange(changes, c) + err := w.mergeChange(changes, c) if err != nil { return err } @@ -209,7 +209,7 @@ func (w *MachinesWatcher) loop() (err error) { case <-w.tomb.Dying(): return tomb.ErrDying case c := <-ch: - err := w.appendChange(changes, c) + err := w.mergeChange(changes, c) if err != nil { return err }
mstate: s/appendChange/mergeChange/g
juju_juju
train
go
f9af2f8e2ff9fb822f0c1b388ab001afd9aa9edd
diff --git a/src/Stagehand/TestRunner/Core/Bootstrap.php b/src/Stagehand/TestRunner/Core/Bootstrap.php index <HASH>..<HASH> 100644 --- a/src/Stagehand/TestRunner/Core/Bootstrap.php +++ b/src/Stagehand/TestRunner/Core/Bootstrap.php @@ -90,8 +90,8 @@ class Bootstrap protected function configureApplicationContext() { $environment = new Environment(); - $environment->setWorkingDirectoryAtStartup(workingDirectoryAtStartup()); - $environment->setPreloadScript(preloadScript()); + $environment->setWorkingDirectoryAtStartup(function_exists('Stagehand\TestRunner\Core\workingDirectoryAtStartup') ? workingDirectoryAtStartup() : $GLOBALS['STAGEHAND_TESTRUNNER_workingDirectoryAtStartup']); + $environment->setPreloadScript(function_exists('Stagehand\TestRunner\Core\preloadScript') ? preloadScript() : $GLOBALS['STAGEHAND_TESTRUNNER_preloadScript']); $applicationContext = new ApplicationContext(); $applicationContext->setComponentFactory(new ComponentFactory());
[Core] Fixed a defect that caused an error "Fatal error: Call to undefined function Stagehand\TestRunner\Core\workingDirectoryAtStartup() in ..." to be raised when launching a test with an older testrunner command. (Issue #<I>)
piece_stagehand-testrunner
train
php
98e504912564a8f9032995d5344d6b5de3f8c2ed
diff --git a/tests/test_accuracy.py b/tests/test_accuracy.py index <HASH>..<HASH> 100644 --- a/tests/test_accuracy.py +++ b/tests/test_accuracy.py @@ -14,6 +14,7 @@ arch_data = { # (steps, [hit addrs], finished) } def emulate(arch): + print 'For', arch steps, hit_addrs, finished = arch_data[arch] filepath = test_location + arch + '/test_arrays' p = angr.Project(filepath, use_sim_procedures=False) @@ -33,6 +34,9 @@ def emulate(arch): else: raise ValueError("This pathgroup does not contain a path we can use for this test?") + for x in path.backtrace: + print x + nose.tools.assert_greater_equal(path.length, steps) for addr in hit_addrs: nose.tools.assert_in(addr, path.addr_backtrace)
Add debug printing so I can tell what the hell is going on
angr_angr
train
py
6a9b3042189bff59226dbd259ccfeb994d1b05bb
diff --git a/src/playbacks/flash/flash.js b/src/playbacks/flash/flash.js index <HASH>..<HASH> 100644 --- a/src/playbacks/flash/flash.js +++ b/src/playbacks/flash/flash.js @@ -177,7 +177,7 @@ class Flash extends Playback { destroy() { clearInterval(this.bootstrapId) - this.stopListening() + super.stopListening() this.$el.remove() }
Call super.stopListening for the flash playback.
clappr_clappr
train
js
7e657745b319ec7540ee04c9a38c7a7db5c7337a
diff --git a/src/trumbowyg.js b/src/trumbowyg.js index <HASH>..<HASH> 100644 --- a/src/trumbowyg.js +++ b/src/trumbowyg.js @@ -681,6 +681,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { setTimeout(function () { t.semanticCode(false, true); t.$c.trigger('tbwpaste', e); + t.$c.trigger('tbwchange'); }, 0); });
fix: trigger tbwchange even on tbwpaste fix #<I>
Alex-D_Trumbowyg
train
js
57eb989ca8e21023d3cab7f91b699fab2df2016e
diff --git a/src/Picqer/Financials/Moneybird/Entities/SalesInvoiceDetail.php b/src/Picqer/Financials/Moneybird/Entities/SalesInvoiceDetail.php index <HASH>..<HASH> 100644 --- a/src/Picqer/Financials/Moneybird/Entities/SalesInvoiceDetail.php +++ b/src/Picqer/Financials/Moneybird/Entities/SalesInvoiceDetail.php @@ -18,6 +18,7 @@ class SalesInvoiceDetail extends Model 'ledger_account_id', 'amount', 'description', + 'period', 'price', 'row_order', 'total_price_excl_tax_with_discount',
Added 'period' as fillable attribute for SalesInvoiceDetail
picqer_moneybird-php-client
train
php
d6a7ced32cd28429d5ea9507f1e0077089ebd686
diff --git a/lib/browser/api/menu-item-roles.js b/lib/browser/api/menu-item-roles.js index <HASH>..<HASH> 100644 --- a/lib/browser/api/menu-item-roles.js +++ b/lib/browser/api/menu-item-roles.js @@ -7,7 +7,7 @@ const roles = { } }, close: { - label: 'Close', + label: process.platform === 'darwin' ? 'Close Window' : 'Close', accelerator: 'CommandOrControl+W', windowMethod: 'close' },
MenuItem: Use 'Close Window' for 'close' role label On OS X, the standard label that's used for the 'close' role is 'Close Window'. You can see this in the default macOS apps from Apple.
electron_electron
train
js
319e657c8fe6ef9157b3740ea95276d7629e8358
diff --git a/src/python/setup.py b/src/python/setup.py index <HASH>..<HASH> 100755 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -8,13 +8,13 @@ if sys.version_info < (2, 7): # Don't import, but use execfile. # Importing would trigger interpretation of the dxpy entry point, which can fail if deps are not installed. -execfile('dxpy/toolkit_version.py') +execfile(os.path.join(os.path.dirname(__file__), 'dxpy', 'toolkit_version.py')) # Grab all the scripts from dxpy/scripts and install them without their .py extension. # Replace underscores with dashes. # See Readme.md for details. scripts = [] -for module in os.listdir('dxpy/scripts'): +for module in os.listdir(os.path.join(os.path.dirname(__file__), 'dxpy', 'scripts')): if module == '__init__.py' or module[-3:] != '.py': continue module = module[:-3]
ensure paths are normalized wrt setup.py
dnanexus_dx-toolkit
train
py
3004fe3915223598c6af5c0a9ce0156d63532e29
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index <HASH>..<HASH> 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -350,7 +350,7 @@ class TestInvocationVariants: result = testdir.runpytest("--pyargs", "tpkg.test_hello") assert result.ret != 0 result.stderr.fnmatch_lines([ - "*file*not*found*test_hello", + "*file*not*found*test_hello*", ]) def test_cmdline_python_package_not_exists(self, testdir):
fix the last committed laxation of a test
vmalloc_dessert
train
py
b44e9a59acdae253512a95e623672fb3b5009860
diff --git a/LiSE/LiSE/proxy.py b/LiSE/LiSE/proxy.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/proxy.py +++ b/LiSE/LiSE/proxy.py @@ -5,7 +5,6 @@ import sys import logging from os import getpid from collections import ( - defaultdict, Mapping, MutableMapping, MutableSequence
Remove unused collections.defaultdict import from LiSE.proxy I've made my own defaultdict workalikes.
LogicalDash_LiSE
train
py
2b6a866b3500c013ccd38b89b32709e25f4fb9f0
diff --git a/salt/client.py b/salt/client.py index <HASH>..<HASH> 100644 --- a/salt/client.py +++ b/salt/client.py @@ -176,11 +176,14 @@ class LocalClient(object): 'is the Salt Master running?') return {} - # Check for no minions - if not pub_data['minions']: - print('No minions matched the target. ' - 'No command was sent, no jid was assigned.') - return {} + # If we order masters (via a syndic), don't short circuit if no minions + # are found + if not self.opts.get('order_masters'): + # Check for no minions + if not pub_data['minions']: + print('No minions matched the target. ' + 'No command was sent, no jid was assigned.') + return {} return pub_data
Check for 'order_masters' before skipping command/jid on no minions
saltstack_salt
train
py
54be74fff4c0607d197aedb751bf8117bd7c10a9
diff --git a/lime/explanation.py b/lime/explanation.py index <HASH>..<HASH> 100644 --- a/lime/explanation.py +++ b/lime/explanation.py @@ -180,7 +180,7 @@ class Explanation(object): var pp_div = top_div.append('div').classed('lime predict_proba', true); var pp_svg = pp_div.append('svg').style('width', '100%%'); var pp = new lime.PredictProba(pp_svg, %s, %s); - ''' % (jsonize(self.class_names), jsonize(list(self.predict_proba))) + ''' % (jsonize(self.class_names), jsonize(list(self.predict_proba.astype(float)))) exp_js = '''var exp_div; var exp = new lime.Explanation(%s);
Minor bug that may be caused with jsonizing numpy arrays
marcotcr_lime
train
py
e8e0a824879b65c5034dd784a6514013b4cccb9a
diff --git a/normandy/settings.py b/normandy/settings.py index <HASH>..<HASH> 100644 --- a/normandy/settings.py +++ b/normandy/settings.py @@ -254,7 +254,7 @@ class Build(Production): class Test(Base): DOTENV_EXISTS = os.path.exists(os.path.join(Core.BASE_DIR, '.env')) DOTENV = '.env' if DOTENV_EXISTS else None - SECRET_KEY = values.Value('not a secret') + SECRET_KEY = 'not a secret' DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage' - SECURE_SSL_REDIRECT = values.BooleanValue(False) - STATICFILES_STORAGE = values.Value('django.contrib.staticfiles.storage.StaticFilesStorage') + SECURE_SSL_REDIRECT = False + STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
Don't allow important settings for tests to be overwritten
mozilla_normandy
train
py
6ad2938a70d3f0b1ff9578d116c88ea3e615b7e2
diff --git a/lib/builderator/tasks/cookbook.rb b/lib/builderator/tasks/cookbook.rb index <HASH>..<HASH> 100644 --- a/lib/builderator/tasks/cookbook.rb +++ b/lib/builderator/tasks/cookbook.rb @@ -9,7 +9,7 @@ module Builderator desc 'metadata [PATH = ./]', 'Use cookbook matadata file at PATH/metadata.rb to generate PATH/matadata.json' def metadata(cookbook_path = './') - invoke :version, :current, [], options + invoke 'version:current', [], options Util::Cookbook.path(cookbook_path) create_file File.join(Util::Cookbook.path, 'metadata.json'),
Fix thor-scmversion invocation in cookbook tasks
rapid7_builderator
train
rb
81394473fce5fe18bb1e989f6252bea6e7a3a0f1
diff --git a/scripts/patchTemplateHelper.php b/scripts/patchTemplateHelper.php index <HASH>..<HASH> 100755 --- a/scripts/patchTemplateHelper.php +++ b/scripts/patchTemplateHelper.php @@ -67,7 +67,8 @@ $regexps = array( '^style$' ), 'JS' => array( - '^on' + '^on', + '^data-s9e-livepreview-postprocess$' ), 'URL' => array( '^action$', diff --git a/src/s9e/TextFormatter/Configurator/Helpers/TemplateHelper.php b/src/s9e/TextFormatter/Configurator/Helpers/TemplateHelper.php index <HASH>..<HASH> 100644 --- a/src/s9e/TextFormatter/Configurator/Helpers/TemplateHelper.php +++ b/src/s9e/TextFormatter/Configurator/Helpers/TemplateHelper.php @@ -467,7 +467,7 @@ abstract class TemplateHelper */ public static function getJSNodes(DOMDocument $dom) { - $regexp = '/^(?:on|data-s9e-livepreview-postprocess$)/i'; + $regexp = '/^(?:data-s9e-livepreview-postprocess$|on)/i'; $nodes = array_merge( self::getAttributesByRegexp($dom, $regexp), self::getElementsByRegexp($dom, '/^script$/i')
Updated patchTemplateHelper.php to consider data-s9e-livepreview-postprocess as a JavaScript attribute
s9e_TextFormatter
train
php,php
f1b87943fe88cc258c2206e22773175642458a23
diff --git a/src/test/java/org/robolectric/shadows/SQLiteOpenHelperTest.java b/src/test/java/org/robolectric/shadows/SQLiteOpenHelperTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/robolectric/shadows/SQLiteOpenHelperTest.java +++ b/src/test/java/org/robolectric/shadows/SQLiteOpenHelperTest.java @@ -224,6 +224,18 @@ public class SQLiteOpenHelperTest { database.execSQL("DROP TABLE IF EXISTS foo;"); } + @Test + public void testCloseThenOpen() throws Exception { + final String TABLE_NAME1 = "fart"; + SQLiteDatabase db1 = helper.getWritableDatabase(); + setupTable(db1, TABLE_NAME1); + insertData(db1, TABLE_NAME1, new int[]{1, 2}); + verifyData(db1, TABLE_NAME1, 2); + db1.close(); + db1 = helper.getWritableDatabase(); + assertThat(db1.isOpen()).isTrue(); + } + private static void assertInitialDB(SQLiteDatabase database, TestOpenHelper helper) { assertDatabaseOpened(database, helper); assertThat(helper.onCreateCalled).isTrue();
Added test case for checking if database is open after closing and opening again.
robolectric_robolectric
train
java
c7279b66d5434f504911d495750c89ad6f6c8290
diff --git a/system/core/classes/Tool.php b/system/core/classes/Tool.php index <HASH>..<HASH> 100644 --- a/system/core/classes/Tool.php +++ b/system/core/classes/Tool.php @@ -401,13 +401,8 @@ class Tool * @param integer $limit Max file size * @return boolean Returns true on success, false otherwise */ - public static function writeCsv( - $file, - array $data, - $delimiter = ',', - $enclosure = '"', - $limit = 0 - ) { + public static function writeCsv($file, array $data, $delimiter = ',', $enclosure = '"', $limit = 0) + { $handle = fopen($file, 'a+'); @@ -507,12 +502,8 @@ class Tool * @param mixed $value * @param string $glue */ - public static function setArrayValue( - array &$array, - $parents, - $value, - $glue = '.' - ) { + public static function setArrayValue(array &$array, $parents, $value, $glue = '.') + { $ref = &$array; if (is_string($parents)) {
Refactoring core\classes\Tool
gplcart_gplcart
train
php
8bac45156df2587a16de4916b8e0e5daac371789
diff --git a/lib/project.js b/lib/project.js index <HASH>..<HASH> 100644 --- a/lib/project.js +++ b/lib/project.js @@ -2,7 +2,6 @@ var _ = require('underscore'), slugify = require('slugs'); function Project(name, unlisted) { - this.id = _.uniqueId(); this.name = name; this.slug = slugify(name); this.createdDate = new Date();
Ditch unused id... uniqueId doesn't do what I wanted here anyway
wachunga_omega
train
js
9d72aa7d704fba0115b28a4723c0f97f33f8b62d
diff --git a/impact_functions/flood/flood_building_impact.py b/impact_functions/flood/flood_building_impact.py index <HASH>..<HASH> 100644 --- a/impact_functions/flood/flood_building_impact.py +++ b/impact_functions/flood/flood_building_impact.py @@ -65,7 +65,8 @@ class FloodBuildingImpactFunction(FunctionProvider): result_dict = {self.target_field: x} # Carry all original attributes forward - for key in attributes: + # FIXME (Ole): Make this part of the interpolation (see issue #101) + for key in attribute_names: result_dict[key] = E.get_data(key, i) # Record result for this feature
Finished flood building function change closing issue #<I>
inasafe_inasafe
train
py
0129c499344e0a3e4f98fed2cd87c65abc3ea20b
diff --git a/src/scs_core/sys/node.py b/src/scs_core/sys/node.py index <HASH>..<HASH> 100644 --- a/src/scs_core/sys/node.py +++ b/src/scs_core/sys/node.py @@ -45,12 +45,23 @@ class Node(object): # ---------------------------------------------------------------------------------------------------------------- + @abstractmethod + def home_dir(self): + pass - # ---------------------------------------------------------------------------------------------------------------- + @abstractmethod + def lock_dir(self): + pass + + + @abstractmethod + def tmp_dir(self): + pass + @abstractmethod - def scs_dir(self): + def command_dir(self): pass @@ -67,3 +78,8 @@ class Node(object): @abstractmethod def osio_dir(self): pass + + + @abstractmethod + def eep_image(self): + pass
Refactored hard-coded paths.
south-coast-science_scs_core
train
py
3cb0d60d3d0870f1d9ac83e5dbeaa06d2888231f
diff --git a/lib/puppet/network/http_server/mongrel.rb b/lib/puppet/network/http_server/mongrel.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/network/http_server/mongrel.rb +++ b/lib/puppet/network/http_server/mongrel.rb @@ -64,11 +64,11 @@ module Puppet::Network # behaviour and we have to subclass Mongrel::HttpHandler so our handler # works for Mongrel. @xmlrpc_server = Puppet::Network::XMLRPCServer.new - handlers.each do |name, args| + handlers.each do |name| unless handler = Puppet::Network::Handler.handler(name) raise ArgumentError, "Invalid handler %s" % name end - @xmlrpc_server.add_handler(handler.interface, handler.new(args)) + @xmlrpc_server.add_handler(handler.interface, handler.new({})) end end
Fixing how the mongrel server sets up xmlrpc handlers. It was trying to use arguments but they were never actually set.
puppetlabs_puppet
train
rb
d0107fad5a74606eae97591f9ce3e4d2ef7ccec8
diff --git a/src/sap.ui.core/src/sap/ui/Device.js b/src/sap.ui.core/src/sap/ui/Device.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/Device.js +++ b/src/sap.ui.core/src/sap/ui/Device.js @@ -1173,7 +1173,8 @@ if (typeof window.sap.ui !== "object") { } function windowSize(){ - return [document.documentElement.clientWidth, document.documentElement.clientHeight]; + + return [window.innerWidth, window.innerHeight]; } function convertToPx(val, unit){
[FIX] Device.js: Fix Resizing - There was an issue with browser window resizing through the use of document.documentElement.clientHeight/.clientWidth instead of the newer property window.innerHeight/.innerWidth . Change-Id: I<I>d<I>ecfd<I>da<I>f8a3b<I>bb0fb<I>fdb5d<I> BCP: <I>
SAP_openui5
train
js
7e35748f31941d6b98466f3201d1582d2ba61a4f
diff --git a/src/effector/stdlib/graph.js b/src/effector/stdlib/graph.js index <HASH>..<HASH> 100644 --- a/src/effector/stdlib/graph.js +++ b/src/effector/stdlib/graph.js @@ -38,6 +38,9 @@ export const clearNode = ( }) graph.from.length = 0 graph.next.length = 0 + graph.seq.length = 0 + //$off + graph.scope = null } export const getGraph = (graph: Graphite): Graph =>
allow clearNode to erase seq and scope
zerobias_effector
train
js
e0caceb1d27937ae0630a361812bef1f606ccde4
diff --git a/tests/test_data.py b/tests/test_data.py index <HASH>..<HASH> 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -170,6 +170,6 @@ class TestData(unittest.TestCase): data.extend(expected_list.get("data")) t = Test() - self.assertEqual(t.output(), json.dumps(expected_list)) + self.assertEqual(json.loads(t.output()), expected_list)
fix test_RPC failing due to randomness
20c_vodka
train
py
833005266ff21be741dcf7a61253a22bf36253f0
diff --git a/src/Rasterization/SVGRasterizer.php b/src/Rasterization/SVGRasterizer.php index <HASH>..<HASH> 100644 --- a/src/Rasterization/SVGRasterizer.php +++ b/src/Rasterization/SVGRasterizer.php @@ -84,8 +84,8 @@ class SVGRasterizer public function render($rendererId, array $params, SVGNode $context) { - return (self::getRenderer($rendererId)) - ->render($this, $params, $context); + $renderer = self::getRenderer($rendererId); + return $renderer->render($this, $params, $context); }
Fix "unexpected T_OBJECT_OPERATOR" in SVGRasterizer
meyfa_php-svg
train
php
d2f2b6f316b40b4a03f8f541996ab42da1e477a0
diff --git a/chef/recipes/default.rb b/chef/recipes/default.rb index <HASH>..<HASH> 100644 --- a/chef/recipes/default.rb +++ b/chef/recipes/default.rb @@ -16,4 +16,4 @@ # Default runtimes, last one will be the default. ruby_runtime('chef') { provider :chef } if node['poise-ruby']['install_chef_ruby'] -ruby_runtime 'ruby' if node['poise-ruby']['install_ruby'] +ruby_runtime('ruby') { version '' } if node['poise-ruby']['install_ruby']
Fix the version for the default ruby.
poise_poise-ruby
train
rb
a55523d4d77d1381f27a337a9d135cbe2414733b
diff --git a/go/mysql/conn.go b/go/mysql/conn.go index <HASH>..<HASH> 100644 --- a/go/mysql/conn.go +++ b/go/mysql/conn.go @@ -1071,7 +1071,15 @@ func (c *Conn) handleComStmtExecute(handler Handler, data []byte) (kontinue bool return true } -func (c *Conn) handleComPrepare(handler Handler, data []byte) bool { +func (c *Conn) handleComPrepare(handler Handler, data []byte) (kontinue bool) { + c.startWriterBuffering() + defer func() { + if err := c.endWriterBuffering(); err != nil { + log.Errorf("conn %v: flush() failed: %v", c.ID(), err) + kontinue = false + } + }() + query := c.parseComPrepare(data) c.recycleReadPacket()
send single tcp packet containing all the mysql packets for prepare command
vitessio_vitess
train
go
e50926a685a61316dbd9f5d191409542377c9231
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -45,6 +45,13 @@ app.configure(function () { }); }); +app.get('/', function (req, res, next) { + res.send(200, { + 'pouchdb-server': 'Welcome!', + 'version': '0.1.0' + }); +}); + // TODO: Remove this: https://github.com/nick-thompson/pouch-server/issues/1 app.get('/_uuids', function (req, res, next) { req.query.count = req.query.count || 1; @@ -55,10 +62,11 @@ app.get('/_uuids', function (req, res, next) { }); }); -app.get('/', function (req, res, next) { - res.send(200, { - 'pouchdb-server': 'Welcome!', - 'version': '0.1.0' +// List all databases. +app.get('/_all_dbs', function (req, res, next) { + Pouch.allDbs(function (err, response) { + if (err) res.send(500, Pouch.UNKNOWN_ERROR); + res.send(200, response); }); });
Added all_dbs route
pouchdb_pouchdb-server
train
js
81f9ac1bc26fd0900349f3cd58dd67e656a7c403
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 @@ -1,2 +1,6 @@ -require 'coveralls' -Coveralls.wear! +begin + require 'coveralls' + Coveralls.wear! +rescue LoadError + warn "warning: coveralls gem not found; skipping Coveralls" +end
gracefully handle missing coveralls gem If we do not have coveralls installed, we should be able to continue with the rest of the test suite.
sporkmonger_addressable
train
rb
de3c75ce55b27f289bd7bc51fc686338c24e2691
diff --git a/src/test/java/io/github/bonigarcia/wdm/test/generic/GenericCreateTest.java b/src/test/java/io/github/bonigarcia/wdm/test/generic/GenericCreateTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/github/bonigarcia/wdm/test/generic/GenericCreateTest.java +++ b/src/test/java/io/github/bonigarcia/wdm/test/generic/GenericCreateTest.java @@ -18,9 +18,11 @@ package io.github.bonigarcia.wdm.test.generic; import static java.lang.invoke.MethodHandles.lookup; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.condition.OS.LINUX; import static org.slf4j.LoggerFactory.getLogger; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.openqa.selenium.WebDriver; @@ -34,6 +36,7 @@ import io.github.bonigarcia.wdm.WebDriverManager; * @author Boni Garcia * @since 5.0.0 */ +@EnabledOnOs(LINUX) class GenericCreateTest { final Logger log = getLogger(lookup().lookupClass());
Run generic driver test only in Linux (since it uses Chrome in Docker)
bonigarcia_webdrivermanager
train
java
2ab0f175326935a0efcc0f20b7d895a43ad9e485
diff --git a/test/on_yubikey/yubikey_conditions.py b/test/on_yubikey/yubikey_conditions.py index <HASH>..<HASH> 100644 --- a/test/on_yubikey/yubikey_conditions.py +++ b/test/on_yubikey/yubikey_conditions.py @@ -69,5 +69,10 @@ def is_not_roca(dev): return not is_cve201715361_vulnerable_firmware_version(dev.version) +@yubikey_condition +def can_write_config(dev): + return dev.can_write_config + + def version_min(min_version): return yubikey_condition(lambda dev: dev.version >= min_version)
Add yubikey_condition.can_write_config
Yubico_yubikey-manager
train
py
896a481f24d358c6dc2b2c9c34820acd6dfaa403
diff --git a/host/libvirt_lxc_backend.go b/host/libvirt_lxc_backend.go index <HASH>..<HASH> 100644 --- a/host/libvirt_lxc_backend.go +++ b/host/libvirt_lxc_backend.go @@ -477,7 +477,9 @@ func (l *LibvirtLXCBackend) Run(job *host.Job, runConfig *RunConfig) (err error) } for i, p := range job.Config.Ports { if p.Proto != "tcp" && p.Proto != "udp" { - return fmt.Errorf("unknown port proto %q", p.Proto) + err := fmt.Errorf("unknown port proto %q", p.Proto) + g.Log(grohl.Data{"at": "alloc_port", "proto": p.Proto, "status": "error", "err": err}) + return err } if p.Port == 0 {
host: Add error log line for bad port protocol
flynn_flynn
train
go
f7d34ab76006bab2e64594fbb0ec56bef2f5cfa5
diff --git a/pymatgen/alchemy/transmuters.py b/pymatgen/alchemy/transmuters.py index <HASH>..<HASH> 100644 --- a/pymatgen/alchemy/transmuters.py +++ b/pymatgen/alchemy/transmuters.py @@ -25,7 +25,6 @@ __date__ = "Mar 4, 2012" import os import re -import warnings from multiprocessing import Pool from pymatgen.alchemy.materials import TransformedStructure @@ -173,16 +172,7 @@ class StandardTransmuter(object): output_dir, following the format output_dir/{formula}_{number}. Args: - vasp_input_set: pymatgen.io.vasp.set.VaspInputSet to create - vasp input files from structures - output_dir: Directory to output files - create_directory (bool): Create the directory if not present. - Defaults to True. - subfolder: Callable to create subdirectory name from - transformed_structure. e.g., - lambda x: x.other_parameters["tags"][0] to use the first tag. - include_cif (bool): Whether to output a CIF as well. CIF files - are generally better supported in visualization programs. + \\*\\*kwargs: All kwargs supported by batch_write_vasp_input. """ batch_write_vasp_input(self.transformed_structures, **kwargs)
Fix deprecated docs.
materialsproject_pymatgen
train
py
ff087a6f575f9bf727c99846cd91ce9bf9e8758d
diff --git a/packages/neos-ui-decorators/src/neos.js b/packages/neos-ui-decorators/src/neos.js index <HASH>..<HASH> 100644 --- a/packages/neos-ui-decorators/src/neos.js +++ b/packages/neos-ui-decorators/src/neos.js @@ -22,7 +22,7 @@ export default mapRegistriesToProps => WrappedComponent => { render() { const {configuration, globalRegistry} = this.context; - const registriesToPropsMap = mapRegistriesToProps ? mapRegistriesToProps(globalRegistry, this.props) : {}; + const registriesToPropsMap = mapRegistriesToProps ? mapRegistriesToProps(globalRegistry) : {}; return ( <WrappedComponent
revert change to @neos decorator
neos_neos-ui
train
js
9582aa3f3c77bdf8bc0140371f63127089d1c370
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionValidator.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionValidator.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionValidator.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBeanDefinitionValidator.java @@ -54,7 +54,6 @@ class ConfigurationPropertiesBeanDefinitionValidator implements BeanFactoryPostP private void validate(ConfigurableListableBeanFactory beanFactory, String beanName) { Class<?> beanClass = beanFactory.getType(beanName, false); - System.out.println(beanName); if (beanClass != null && BindMethod.forClass(beanClass) == BindMethod.VALUE_OBJECT) { throw new BeanCreationException(beanName, "@EnableConfigurationProperties or @ConfigurationPropertiesScan must be used to add "
Remove accidentally committed debug sysout
spring-projects_spring-boot
train
java
faf293644fe59f018a41baadfda105d1f9fc957f
diff --git a/tests/Filesystem/FilesystemAdapterTest.php b/tests/Filesystem/FilesystemAdapterTest.php index <HASH>..<HASH> 100644 --- a/tests/Filesystem/FilesystemAdapterTest.php +++ b/tests/Filesystem/FilesystemAdapterTest.php @@ -52,6 +52,15 @@ class FilesystemAdapterTest extends TestCase // $this->assertEquals('attachment; filename="hello.txt"', $response->headers->get('content-disposition')); } + public function testDownloadNonAsciiFilename() + { + $this->filesystem->write('file.txt', 'Hello World'); + $files = new FilesystemAdapter($this->filesystem); + $response = $files->download('file.txt', 'пиздюк.txt'); + $this->assertInstanceOf(StreamedResponse::class, $response); + // $this->assertEquals('attachment; filename="hello.txt"', $response->headers->get('content-disposition')); + } + public function testExists() { $this->filesystem->write('file.txt', 'Hello World');
add test for exception: The filename fallback must only contain ASCII characters.
laravel_framework
train
php
6cf03b9c2b79a97bf80d3337716d52a536023872
diff --git a/dev/Deprecation.php b/dev/Deprecation.php index <HASH>..<HASH> 100644 --- a/dev/Deprecation.php +++ b/dev/Deprecation.php @@ -26,11 +26,22 @@ * When set per-module, only direct calls to deprecated methods from those modules are considered - if the module * calls a non-module method which then calls a deprecated method, that call will use the global check version, not * the module specific check version. + * + * @package sapphire + * @subpackage dev */ class Deprecation { + /** + * + * @var string + */ protected static $version; + /** + * + * @var array + */ protected static $module_version_overrides = array(); /** @@ -92,7 +103,7 @@ class Deprecation { $level = (int)$level; if(!$level) $level = 1; $called = $backtrace[$level]; - + if (isset($called['class'])) { return $called['class'] . $called['type'] . $called['function']; } @@ -104,7 +115,7 @@ class Deprecation { /** * Raise a notice indicating the method is deprecated if the version passed as the second argument is greater * than or equal to the check version set via ::notification_version - * + * * @static * @param $string - The notice to raise * @param $atVersion - The version at which this notice should start being raised @@ -167,5 +178,4 @@ class Deprecation { self::$version = $settings['version']; self::$module_version_overrides = $settings['moduleVersions']; } - } \ No newline at end of file
MINOR Fixed whitespace and added docblocks
silverstripe_silverstripe-framework
train
php
f4e9af2f4d68313b9275332d7662da5398396f43
diff --git a/lib/stream.js b/lib/stream.js index <HASH>..<HASH> 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -17,7 +17,7 @@ MarketoStream.prototype._setData = function(dataPromise) { this._dataPromise = dataPromise; return dataPromise.then( function(data) { - if (data.result.length > 0) { + if (data.result && data.result.length > 0) { self._data = data; self._resultIndex = 0; self._ready = true;
validating data.result is not null
MadKudu_node-marketo
train
js
9267f2e5011358638f3b346a3843e62e086cac93
diff --git a/Tests/format/FormatXmlTest.php b/Tests/format/FormatXmlTest.php index <HASH>..<HASH> 100644 --- a/Tests/format/FormatXmlTest.php +++ b/Tests/format/FormatXmlTest.php @@ -53,9 +53,9 @@ class JRegistryFormatXMLTest extends PHPUnit_Framework_TestCase "</registry>\n"; // Test basic object to string. - $this->assertThat( + $this->assertXmlStringEqualsXmlString( $class->objectToString($object, $options), - $this->equalTo($string) + $string ); }
Test XML String equivalency, not simple string equality
joomla-framework_registry
train
php
f1875aeb42e5ddd65ba62a62431bfdb2a1c97a2f
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -48,7 +48,7 @@ master_doc = 'index' # General information about the project. project = u'RarFile' -copyright = u'2005-2019, Marko Kreen' +copyright = None # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the
doc: drop copyright, it messes style up
markokr_rarfile
train
py
8603ef22eae57a7ef6cc0615782ade8af7a2b7d1
diff --git a/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java b/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java index <HASH>..<HASH> 100644 --- a/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java +++ b/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java @@ -52,12 +52,7 @@ public class PreferencesFx { private PreferencesFxPresenter preferencesFxPresenter; private PreferencesFx(Class<?> saveClass, Category... categories) { - // asciidoctor Documentation - tag::testMock[] - preferencesFxModel = new PreferencesFxModel( - new StorageHandlerImpl(saveClass), new SearchHandler(), new History(), categories - ); - init(); - // asciidoctor Documentation - end::testMock[] + this(new StorageHandlerImpl(saveClass), categories); } private PreferencesFx(StorageHandler storageHandler, Category... categories) {
replace duplicated creation of model with call of other constructor
dlemmermann_PreferencesFX
train
java
7d8d68c2046e2cc7972d54eeba0de82acb5c5809
diff --git a/bin/simulate_consistency.py b/bin/simulate_consistency.py index <HASH>..<HASH> 100644 --- a/bin/simulate_consistency.py +++ b/bin/simulate_consistency.py @@ -142,8 +142,8 @@ def simulate(df1, df2, bed_dict, non_tested_genes, opts): permutation_df2 = pt.handle_tsg_results(permutation_result2) # calculate jaccard similarity - deleterious_jaccard = sim.jaccard_index(permutation_df1['deleterious p-value'], - permutation_df2['deleterious p-value']) + deleterious_jaccard = sim.jaccard_index(permutation_df1['deleterious BH q-value'], + permutation_df2['deleterious BH q-value']) # rank genes deleterious_rank1, deleterious_rank2 = sim.rank_genes(permutation_df1['deleterious p-value'].copy(),
Fixed bug where p-values were used for calculating jaccard index instead of FDR
KarchinLab_probabilistic2020
train
py
6bde60a8d63a89bd5a4aa70e4c3d1bbef4b812e6
diff --git a/lib/stagehand/connection_adapter_extensions.rb b/lib/stagehand/connection_adapter_extensions.rb index <HASH>..<HASH> 100644 --- a/lib/stagehand/connection_adapter_extensions.rb +++ b/lib/stagehand/connection_adapter_extensions.rb @@ -48,7 +48,7 @@ module Stagehand private def update_readonly_state - readonly! if @config[:database] == Database.production_database_name + readonly! unless Configuration.single_connection? || @config[:database] != Database.production_database_name end def clear_readonly_state
Don’t make connection readonly if in single_connection mode
culturecode_stagehand
train
rb
7c3d9f1f1c054687c59171e6c68b217bd4966d55
diff --git a/plugins/Monolog/Handler/FailureLogMessageDetector.php b/plugins/Monolog/Handler/FailureLogMessageDetector.php index <HASH>..<HASH> 100644 --- a/plugins/Monolog/Handler/FailureLogMessageDetector.php +++ b/plugins/Monolog/Handler/FailureLogMessageDetector.php @@ -28,7 +28,9 @@ class FailureLogMessageDetector extends AbstractHandler public function handle(array $record) { - $this->hasEncounteredImportantLog = true; + if ($this->isHandling($record)) { + $this->hasEncounteredImportantLog = true; + } } /** @@ -46,4 +48,4 @@ class FailureLogMessageDetector extends AbstractHandler { $this->hasEncounteredImportantLog = false; } -} \ No newline at end of file +}
Only assume important log encountered when log level is >= WARN (#<I>)
matomo-org_matomo
train
php
cfee6b8ff75e6d9ac33f9db967c9dd7a99a4a290
diff --git a/src/Control.Loading.js b/src/Control.Loading.js index <HASH>..<HASH> 100644 --- a/src/Control.Loading.js +++ b/src/Control.Loading.js @@ -39,6 +39,15 @@ L.Control.Loading = L.Control.extend({ this._removeMapListeners(map); }, + removeFrom: function (map) { + // Override Control.removeFrom() to avoid clobbering the entire + // _container, which is the same as zoomControl's + this._container.removeChild(this._indicator); + this._map = null; + this.onRemove(map); + return this; + }, + addLoader: function(id) { this._dataLoaders[id] = true; this.updateIndicator();
Avoid clobbering zoomControl on remove
ebrelsford_Leaflet.loading
train
js
b2d8f6f2b516952eaf17342ede2401ceae995e22
diff --git a/app/helpers/carnival/base_admin_helper.rb b/app/helpers/carnival/base_admin_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/carnival/base_admin_helper.rb +++ b/app/helpers/carnival/base_admin_helper.rb @@ -215,7 +215,7 @@ module Carnival path = action.path(presenter, id: record.id) if action.default_partial == :default - link_to label, path, class: "carnival-action-link #{label.parameterize}" + link_to label, path, class: "carnival-action-link #{label.parameterize}", data: action.data elsif action.default_partial == :delete link_to label, path, class: 'carnival-action-link apagar', method: :delete, data: { confirm: I18n.t('are_you_sure') } end diff --git a/app/models/carnival/action.rb b/app/models/carnival/action.rb index <HASH>..<HASH> 100644 --- a/app/models/carnival/action.rb +++ b/app/models/carnival/action.rb @@ -41,6 +41,10 @@ module Carnival end end + def data + @params[:data] + end + def show(record) return true if !params[:show_func] return true if !record.respond_to? params[:show_func]
Add possibility to add data(s) on actions links
Vizir_carnival
train
rb,rb
7cca585c4d0bbbd8f1264c5016e17ce0996b45d7
diff --git a/lib/knife-cloudformation/knife/base.rb b/lib/knife-cloudformation/knife/base.rb index <HASH>..<HASH> 100644 --- a/lib/knife-cloudformation/knife/base.rb +++ b/lib/knife-cloudformation/knife/base.rb @@ -60,6 +60,7 @@ module KnifeCloudformation # # @param name [String] name of stack def poll_stack(name) + provider.connection.stacks.reload knife_events = Chef::Knife::CloudformationEvents.new knife_events.name_args.push(name) Chef::Config[:knife][:cloudformation][:poll] = true
Force reloading stack API prior to initiating event polling
sparkleformation_sfn
train
rb
42c1660f5e820151855f1c4bb9f4a9773619e919
diff --git a/src/Core/CommandCollector.php b/src/Core/CommandCollector.php index <HASH>..<HASH> 100644 --- a/src/Core/CommandCollector.php +++ b/src/Core/CommandCollector.php @@ -135,9 +135,15 @@ class CommandCollector if (! class_exists(ModuleList::class)) { print "ERROR: Oxid ModuleList class can not be loaded, please run vendor/bin/oe-eshop-unified_namespace_generator"; } else { - $moduleList = oxNew(ModuleList::class); - $modulesDir = $oConfig->getModulesDir(); - $moduleList->getModulesFromDir($modulesDir); + try { + $moduleList = oxNew(ModuleList::class); + $modulesDir = $oConfig->getModulesDir(); + $moduleList->getModulesFromDir($modulesDir); + } catch (\Throwable $exception) { + print "Shop is not able to list modules\n"; + print $exception->getMessage(); + return []; + } } $paths = $this->getPathsOfAvailableModules();
make console able to handle shop exceptions
OXIDprojects_oxid-console
train
php
bf851c14b12ed44a35668b8ff241a34ae331550f
diff --git a/lib/ruby_speech/grxml/builtins.rb b/lib/ruby_speech/grxml/builtins.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_speech/grxml/builtins.rb +++ b/lib/ruby_speech/grxml/builtins.rb @@ -1,6 +1,6 @@ module RubySpeech::GRXML::Builtins # - # Create a grammar for interpreting a boolean response, where 1 is yes and two is no. + # Create a grammar for interpreting a boolean response, where 1 is true and two is false. # # @param [Hash] options Options to parameterize the grammar # @option options [#to_s] :y The positive/truthy/affirmative digit
[DOC] Match up boolean grammar docs with reality
adhearsion_ruby_speech
train
rb
ca6c0113d4d908594bb162d64ee8e73319f96cf6
diff --git a/packages/core/elements/index.js b/packages/core/elements/index.js index <HASH>..<HASH> 100644 --- a/packages/core/elements/index.js +++ b/packages/core/elements/index.js @@ -5,20 +5,20 @@ polyfillLoader.then(res => { import(/* webpackMode: 'eager', webpackChunkName: 'replace-with-children' - */ '@bolt/core/elements/replace-with-children'); + */ './replace-with-children'); } if (!window.customElements.get('replace-with-grandchildren')) { import(/* webpackMode: 'eager', webpackChunkName: 'replace-with-grandchildren' - */ '@bolt/core/elements/replace-with-grandchildren'); + */ './replace-with-grandchildren'); } if (!window.customElements.get('bolt-action')) { import(/* webpackMode: 'eager', webpackChunkName: 'bolt-action' - */ '@bolt/core/elements/bolt-action'); + */ './bolt-action'); } });
refactor: update Bolt core's element import to use local paths (since we're already in Bolt core)
bolt-design-system_bolt
train
js
08bea734c9c737f89730669336ce0b0d038a57b4
diff --git a/lib/client/bundler/index.js b/lib/client/bundler/index.js index <HASH>..<HASH> 100644 --- a/lib/client/bundler/index.js +++ b/lib/client/bundler/index.js @@ -161,7 +161,7 @@ module.exports = function(ss,options) { return f.substring(0,6) === 'index.'; } function diskToRequire(rel) { - return '/' + rel.replace('\\','/').replace('/./','/'); //TODO drop last replace + return '/' + rel.replace(/\\/g,'/'); } for(var i = 0,rel; (rel = client.paths.code[i]); ++i) {
fix(windows): proper windows separator replacement
socketstream_socketstream
train
js
315a2894287342d3468ce434d100ac5f50e725a0
diff --git a/src/passes/NormalPass.js b/src/passes/NormalPass.js index <HASH>..<HASH> 100644 --- a/src/passes/NormalPass.js +++ b/src/passes/NormalPass.js @@ -73,6 +73,7 @@ export class NormalPass extends Pass { * The desired render resolution. * * @type {Resizer} + * @deprecated Use getResolution() instead. */ this.resolution = new Resizer(this, width, height, resolutionScale); @@ -105,6 +106,18 @@ export class NormalPass extends Pass { } /** + * Returns the resolution settings. + * + * @return {Resolution} The resolution. + */ + + getResolution() { + + return this.resolution; + + } + + /** * Returns the current resolution scale. * * @return {Number} The resolution scale.
Deprecate resolution Replaced by getResolution().
vanruesc_postprocessing
train
js
a16a2e381e72dcb3288bfb55bcf7fcb2272c8608
diff --git a/lib/rails-footnotes/filter.rb b/lib/rails-footnotes/filter.rb index <HASH>..<HASH> 100644 --- a/lib/rails-footnotes/filter.rb +++ b/lib/rails-footnotes/filter.rb @@ -139,7 +139,7 @@ module Footnotes insert_text :before, /<\/head>/i, <<-HTML <!-- Footnotes Style --> <style type="text/css"> - #footnotes_debug {font-size: 11px; font-weight: normal; margin: 2em 0 1em 0; text-align: center; color: #444; line-height: 16px;} + #footnotes_debug {font-size: 11px; font-family: Consolas, monaco, monospace; font-weight: normal; margin: 2em 0 1em 0; text-align: center; color: #444; line-height: 16px;} #footnotes_debug th, #footnotes_debug td {color: #444; line-height: 18px;} #footnotes_debug a {color: #9b1b1b; font-weight: inherit; text-decoration: none; line-height: 18px;} #footnotes_debug table {text-align: center;}
use monospace font Better for code readability. Otherwise it inherits the default font of the site.
josevalim_rails-footnotes
train
rb
eabf5b62b53f4a957235d58d4b904846a1d4f98c
diff --git a/client/state/activity-log/rewind-status/reducer.js b/client/state/activity-log/rewind-status/reducer.js index <HASH>..<HASH> 100644 --- a/client/state/activity-log/rewind-status/reducer.js +++ b/client/state/activity-log/rewind-status/reducer.js @@ -21,7 +21,8 @@ export const rewindStatus = keyedReducer( 'siteId', createReducer( {}, { ...state, active: true, } ), -}, rewindStatusSchema ) ); +} ) ); +rewindStatus.schema = rewindStatusSchema; export const rewindStatusError = keyedReducer( 'siteId', createReducer( {}, { [ REWIND_STATUS_ERROR ]: ( state, { error } ) => error,
Apply persistence schema to rewindStatus (#<I>)
Automattic_wp-calypso
train
js
0d594781da28f422e4397289c4c8ddff5b371ee5
diff --git a/controllers/socket/socket.go b/controllers/socket/socket.go index <HASH>..<HASH> 100644 --- a/controllers/socket/socket.go +++ b/controllers/socket/socket.go @@ -50,11 +50,11 @@ func onDisconnect(id string) { } } -func getEvent(data string) string { +func getEvent(data []byte) string { var js struct { Request string } - json.Unmarshal([]byte(data), &js) + json.Unmarshal(data, &js) return js.Request }
Use new wsevent API for Extractor
TF2Stadium_Helen
train
go
77eff32ddd5a7fc6cfb22a7d40178e556659e467
diff --git a/generators/heroku/index.js b/generators/heroku/index.js index <HASH>..<HASH> 100644 --- a/generators/heroku/index.js +++ b/generators/heroku/index.js @@ -9,8 +9,7 @@ var util = require('util'), const constants = require('../generator-constants'), CLIENT_MAIN_SRC_DIR = constants.CLIENT_MAIN_SRC_DIR, - SERVER_MAIN_RES_DIR = constants.SERVER_MAIN_RES_DIR, - SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR; + SERVER_MAIN_RES_DIR = constants.SERVER_MAIN_RES_DIR; var HerokuGenerator = generators.Base.extend({});
Remove unused variable to pass npm tests
jhipster_generator-jhipster
train
js
0089a69c57621fa79dc7d4948a364dde3791736e
diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index <HASH>..<HASH> 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -466,7 +466,7 @@ class Application extends BaseApplication if (null === $this->composer) { try { - $this->composer = Factory::create($this->io, null, $disablePlugins, $disableScripts); + $this->composer = Factory::create(Platform::isInputCompletionProcess() ? new NullIO() : $this->io, null, $disablePlugins, $disableScripts); } catch (\InvalidArgumentException $e) { if ($required) { $this->io->writeError($e->getMessage());
Avoid outputting network errors or others while loading suggestions
composer_composer
train
php
413e7720015ddb8c206acb9df86956919d760757
diff --git a/openstack_dashboard/test/unit/api/test_neutron.py b/openstack_dashboard/test/unit/api/test_neutron.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/test/unit/api/test_neutron.py +++ b/openstack_dashboard/test/unit/api/test_neutron.py @@ -886,7 +886,7 @@ class NeutronApiTests(test.APITestCase): 'name': 'port%s' % i, 'admin_state_up': True} for i in range(10)] - port_ids = [port['id'] for port in ports] + port_ids = tuple([port['id'] for port in ports]) neutronclient = self.stub_neutronclient() uri_len_exc = neutron_exc.RequestURITooLong(excess=220) @@ -900,7 +900,7 @@ class NeutronApiTests(test.APITestCase): api.neutron.port_list, 'id', port_ids, request=self.request) self.assertEqual(10, len(ret_val)) - self.assertEqual(port_ids, [p.id for p in ret_val]) + self.assertEqual(port_ids, tuple([p.id for p in ret_val])) def test_qos_policies_list(self): exp_policies = self.qos_policies.list()
API tests: Avoid UnhashableKeyWarning Array is not hashable. We need to pass tuple instead to avoid UnhashableKeyWarning. Change-Id: I<I>ce<I>e0dbad<I>d6bf0d9abcc<I>fc1
openstack_horizon
train
py
c8a7e7e30337b4848e673ffb494b214398c60f8a
diff --git a/python_modules/libraries/dagster-postgres/setup.py b/python_modules/libraries/dagster-postgres/setup.py index <HASH>..<HASH> 100644 --- a/python_modules/libraries/dagster-postgres/setup.py +++ b/python_modules/libraries/dagster-postgres/setup.py @@ -30,9 +30,7 @@ if __name__ == "__main__": packages=find_packages(exclude=["test"]), package_data={ "dagster-postgres": [ - "dagster_postgres/event_log/alembic/*", - "dagster_postgres/run_storage/alembic/*", - "dagster_postgres/schedule_storage/alembic/*", + "dagster_postgres/alembic/*", ] }, include_package_data=True,
fix alembic directory references in postgres setup.py Test Plan: bk, but not really. real test is actually creating/publishing the package. Reviewers: dgibson, max Reviewed By: max Differential Revision: <URL>
dagster-io_dagster
train
py
d3fba3dff863982d1fef04501d42155943973ea2
diff --git a/lib/capsum/whenever.rb b/lib/capsum/whenever.rb index <HASH>..<HASH> 100644 --- a/lib/capsum/whenever.rb +++ b/lib/capsum/whenever.rb @@ -3,10 +3,11 @@ require File.expand_path("../../capsum.rb", __FILE__) Capistrano::Configuration.instance(true).load do namespace :whenever do desc 'Update the crontab' - task :update, :roles => :app do + task :update do command = "if [ -e #{current_path}/config/schedule.rb ]; then cd #{current_path}; RAILS_ENV=#{rails_env} whenever --update-crontab #{application} --set primary=%s; fi" - run (command % true), :only => { :primary => true } - run (command % false), :except => { :primary => true } + find_servers(:roles => :app).each do |server| + run (command % (server.options[:primary] == true)), :hosts => server.host + end end desc 'Cleanup the crontab'
fix whenever no primary app server deploy error
sunteya_capsum
train
rb
1445503ea106269fbdbf375227028d8caca82ea3
diff --git a/lib/action_subscriber/rabbit_connection.rb b/lib/action_subscriber/rabbit_connection.rb index <HASH>..<HASH> 100644 --- a/lib/action_subscriber/rabbit_connection.rb +++ b/lib/action_subscriber/rabbit_connection.rb @@ -33,27 +33,16 @@ module ActionSubscriber end def self.setup_recovery - # When the server fails to respond to a heartbeat, we assume that it - # is dead and attempt to reconnect with auto recovery. To accomplish - # this, we must timeout the underlying EventMachine connection. If we - # reconnected manually, the auto recovery code would not be triggered, - # - # Forcing a timeout in EventMachine is a two step process: - # 1. Pause all activity on the connection - # 2. Configure the connection to timeout when there is no activity + # When the server fails to respond to a heartbeat, it is assumed + # to be dead. By closing the underlying EventMachine connection, + # a connection loss is triggered in AMQP . self.connection.on_skipped_heartbeats do |session| - # This completes step 1 - session.pause - - # This completes step 2. Remember that when we run this code a - # skipped heartbeat has already been detected. We want the - # timeout, and consequently auto recovery, to happen immediately - session.comm_inactivity_timeout = 0.01 + EventMachine.close_connection(session.signature, false) end + # When the connection loss is triggered, we reconnect, which + # also runs the auto-recovery code self.connection.on_tcp_connection_loss do |session, settings| - # A reconnect also resets the inactivity timeout to 0.0 and - # resumes the connection session.reconnect(false, 1) end end
Improve auto-recovery This change came about because the pause method is not available in the JRuby version of EventMachine. In my initial version, I overlooked the possibility of closing the EventMachine connection without using its instance methods (all of which prevented auto-recovery). Well, as it turns out, that was idiotic. This method is more straightforward, cleaner, faster, and more reliable. That I missed it the first time around is boggling.
mxenabled_action_subscriber
train
rb
cb7674133a00aa2fd6dae3fd9dd80a6e5907efb6
diff --git a/cmd/admin-info.go b/cmd/admin-info.go index <HASH>..<HASH> 100644 --- a/cmd/admin-info.go +++ b/cmd/admin-info.go @@ -101,10 +101,20 @@ func (u clusterStruct) String() (msg string) { backendType := madmin.Unknown // Set the type of MinIO server ("FS", "Erasure", "Unknown") - if _, ok := u.Info.Backend.(madmin.FSBackend); ok { + switch v := u.Info.Backend.(type) { + case madmin.FSBackend: backendType = madmin.FS - } else if _, ok := u.Info.Backend.(madmin.ErasureBackend); ok { + case madmin.ErasureBackend: backendType = madmin.Erasure + case map[string]interface{}: + vt, ok := v["backendType"] + if ok { + backendTypeS, _ := vt.(string) + switch backendTypeS { + case "Erasure": + backendType = madmin.Erasure + } + } } coloredDot := console.Colorize("Info", dot)
make sure backendType is looked up properly
minio_mc
train
go
b695cc828207a652e7130586baefa3b8a7b77d50
diff --git a/src/League/StatsD/Client.php b/src/League/StatsD/Client.php index <HASH>..<HASH> 100644 --- a/src/League/StatsD/Client.php +++ b/src/League/StatsD/Client.php @@ -106,6 +106,7 @@ class Client * Initialize Connection Details * @param array $options Configuration options * @return Client This instance + * @throws ConfigurationException If port is invalid */ public function configure(array $options = array()) { @@ -256,6 +257,7 @@ class Client * Send Data to StatsD Server * @param array $data A list of messages to send to the server * @return Client This instance + * @throws ConnectionException If there is a connection problem with the host */ protected function send($data) {
Added exception information to docblocks
thephpleague_statsd
train
php
81fcb4452e569717919fa83446a13207651b2353
diff --git a/test/test_language.rb b/test/test_language.rb index <HASH>..<HASH> 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -249,7 +249,7 @@ class TestLanguage < Test::Unit::TestCase assert_equal Language['Nginx'], Language.find_by_filename('nginx.conf').first assert_equal ['C', 'C++', 'Objective-C'], Language.find_by_filename('foo.h').map(&:name).sort assert_equal [], Language.find_by_filename('rb') - assert_equal [], Language.find_by_filename('.nkt') + assert_equal [], Language.find_by_filename('.null') assert_equal [Language['Shell']], Language.find_by_filename('.bashrc') assert_equal [Language['Shell']], Language.find_by_filename('bash_profile') assert_equal [Language['Shell']], Language.find_by_filename('.zshrc')
Rename file for the test on non-existing extension
github_linguist
train
rb
1e041392d2253c47360e49bc64dbca43026419ca
diff --git a/ApplicationConfig/Providers/RootInfo.php b/ApplicationConfig/Providers/RootInfo.php index <HASH>..<HASH> 100644 --- a/ApplicationConfig/Providers/RootInfo.php +++ b/ApplicationConfig/Providers/RootInfo.php @@ -65,7 +65,15 @@ class RootInfo implements Provider if (!$url) { return $path; } + + /** + * If `framework.assets.version: some_version` set, then $version = '?some_version'. + * If `framework.assets: json_manifest_path` is used, then $version = '/'. + */ $version = $this->assetsPackages->getVersion($path); + if (false === strpos($version, '?')) { + return $url; + } return preg_replace('/\?' . $version . '/', '', $url); }
EZEE-<I>: StudioUI doesn't work if symfony/webpack-encore is configu… (#<I>) * EZEE-<I>: StudioUI doesn't work if symfony/webpack-encore is configured to use json_manifest * Add comment with explaination * CS fix * Remove unnecessary preg_quote
ezsystems_PlatformUIBundle
train
php
62097c91ed24c779f4c7b4ffa909fa3954382cc8
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -102,7 +102,7 @@ $ALLOWED_TAGS = */ $ALLOWED_PROTOCOLS = array('http', 'https', 'ftp', 'news', 'mailto', 'rtsp', 'teamspeak', 'gopher', 'mms', 'color', 'callto', 'cursor', 'text-align', 'font-size', 'font-weight', 'font-style', 'font-family', - 'border', 'margin', 'padding', 'background', 'text-decoration'); // CSS as well to get through kses + 'border', 'margin', 'padding', 'background', 'background-color', 'text-decoration'); // CSS as well to get through kses /// Functions
weblib: MDL-<I>: background-color attribute stripped from html. Adding 'background-color' attribute to $ALLOWED_PROTOCOLS array so kses doesn't drop it.
moodle_moodle
train
php
875d85057e4c0120cfa912c0f7c3493abe692055
diff --git a/system/HTTP/IncomingRequest.php b/system/HTTP/IncomingRequest.php index <HASH>..<HASH> 100644 --- a/system/HTTP/IncomingRequest.php +++ b/system/HTTP/IncomingRequest.php @@ -491,9 +491,10 @@ class IncomingRequest extends Request $this->files = new FileCollection(); } - return $this->files->all(); + return $this->files->all(); // return all files } + //-------------------------------------------------------------------- /**
te `getFiles()` to return all files in form
codeigniter4_CodeIgniter4
train
php
17f42928312b7d44d4379fc3c6e84768aaa9118c
diff --git a/src/Storage.php b/src/Storage.php index <HASH>..<HASH> 100644 --- a/src/Storage.php +++ b/src/Storage.php @@ -1048,7 +1048,7 @@ class Storage $contenttypes = array_filter( $contenttypes, function ($ct) use ($app_ct) { - if (($app_ct[$ct]['searchable'] === false) || + if ((isset($app_ct[$ct]['searchable']) && $app_ct[$ct]['searchable'] === false) || (isset($app_ct[$ct]['viewless']) && $app_ct[$ct]['viewless'] === true) ) { return false;
Strict check for "searchable"
bolt_bolt
train
php
15b9f44140fec5b7c3e61485b7d9d029c156549f
diff --git a/src/org/parosproxy/paros/model/SiteNode.java b/src/org/parosproxy/paros/model/SiteNode.java index <HASH>..<HASH> 100644 --- a/src/org/parosproxy/paros/model/SiteNode.java +++ b/src/org/parosproxy/paros/model/SiteNode.java @@ -207,7 +207,7 @@ public class SiteNode extends DefaultMutableTreeNode { // we remove the icons of the node that has to be cleaned when manually visiting them if (!this.icons.isEmpty() && historyReference.getHistoryType() == HistoryReference.TYPE_MANUAL) { for (int i = 0; i < this.clearIfManual.size(); ++i) { - if (this.clearIfManual.get(i) == true && this.icons.size() > i) { + if (this.clearIfManual.get(i) && this.icons.size() > i) { this.icons.remove(i); this.clearIfManual.remove(i); }
Checkstyle cleanup: Simplified conditional expressions
zaproxy_zaproxy
train
java
8b0d121b764e51a49ebfb23e0a53d6d57eaf03a7
diff --git a/salt/states/ipset.py b/salt/states/ipset.py index <HASH>..<HASH> 100644 --- a/salt/states/ipset.py +++ b/salt/states/ipset.py @@ -216,7 +216,7 @@ def present(name, entry=None, family='ipv4', **kwargs): family) else: command = __salt__['ipset.add'](kwargs['set_name'], entry, family, **kwargs) - if not 'Error' in command: + if 'Error' not in command: ret['changes'] = {'locale': name} ret['result'] = True ret['comment'] += 'entry {0} added to set {1} for family {2}\n'.format( @@ -285,7 +285,7 @@ def absent(name, entry=None, entries=None, family='ipv4', **kwargs): family) else: command = __salt__['ipset.delete'](kwargs['set_name'], entry, family, **kwargs) - if not 'Error' in command: + if 'Error' not in command: ret['changes'] = {'locale': name} ret['result'] = True ret['comment'] += 'ipset entry {1} for set {0} removed for family {2}\n'.format(
Fix PEP8 E<I> - test for membership should be "not in"
saltstack_salt
train
py
b61bbf86157df213eb313b7254ec8fa6057160d7
diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/page_spec.rb +++ b/spec/models/page_spec.rb @@ -113,13 +113,13 @@ describe Page do it "all pages except the rootpage must have a parent_id" do page = Factory.build(:page, :page_layout => "anypage", :parent_id => nil, :language => @language) page.valid? - page.errors.to_hash.should have_key(:parent_id) + page.should have(1).error_on(:parent_id) end it "must not be created if the page_layout is set to 'rootpage' and a page already exists with this page_layout and parent_id = nil" do page = Factory.build(:page, :name => "anypage", :page_layout => "rootpage", :parent_id => @language_root.id, :language => @language) page.valid? - page.errors.to_hash.should have_key(:page_layout) + page.should have(1).error_on(:page_layout) end it "should get a webfriendly urlname on create" do
Changes page_spec errors check to correct rspec syntax
AlchemyCMS_alchemy_cms
train
rb
4ee860dc088669bf6e9638652c43f54f0c39ad5d
diff --git a/src/Webiny/Component/Mailer/Bridge/Mandrill/Transport.php b/src/Webiny/Component/Mailer/Bridge/Mandrill/Transport.php index <HASH>..<HASH> 100644 --- a/src/Webiny/Component/Mailer/Bridge/Mandrill/Transport.php +++ b/src/Webiny/Component/Mailer/Bridge/Mandrill/Transport.php @@ -77,9 +77,9 @@ class Transport implements TransportInterface if($this->config->get('Mode', 'template') == 'template'){ unset($message['html']); - $res = $this->mailer->messages->sendTemplate($template, [], $message); + $res = $this->mailer->messages->sendTemplate($template, [], $message, false); } else { - $res = $this->mailer->messages->send($message); + $res = $this->mailer->messages->send($message, false); }
Added async flag for message sending
Webiny_Framework
train
php