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
049ff09b08d7bd90701349260ae51731b0a1bfc7
diff --git a/lib/jsdav.js b/lib/jsdav.js index <HASH>..<HASH> 100644 --- a/lib/jsdav.js +++ b/lib/jsdav.js @@ -74,7 +74,6 @@ exports.createServer = function(options, port, host) { return DAV.createServer(options, port, host); }; -<<<<<<< Updated upstream /** * Create a jsDAV Server object that will not fire up listening to HTTP requests, * but instead will respond to requests that are passed to @@ -95,13 +94,7 @@ exports.createServer = function(options, port, host) { exports.mount = function(options) { var DAV = require("./DAV/server"); DAV.debugMode = exports.debugMode; - return DAV.mount(options); -======= -exports.mount = function(options) { - var DAV = require("./DAV/server"); - DAV.debugMode = exports.debugMode; return DAV.mount(options.path, options.mount, options.server, options.standalone); ->>>>>>> Stashed changes }; //@todo implement CalDAV
Typo produced in merge feature/python
mikedeboer_jsDAV
train
js
41b6d50d5f75ba31bbf313bc6d45519e789f709c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ setup( packages=find_packages(), install_requires=install_requires, classifiers=[ - 'Development Status :: 3 - Alpha', + 'Development Status :: 4 - Beta', 'Framework :: Twisted', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License',
classifiers: I think we're at least Beta now
praekeltfoundation_marathon-acme
train
py
b31f2e0e71eccf8ac7a5450485f1b9da03877d74
diff --git a/java/client/test/org/openqa/selenium/net/LinuxEphemeralPortRangeDetectorTest.java b/java/client/test/org/openqa/selenium/net/LinuxEphemeralPortRangeDetectorTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/net/LinuxEphemeralPortRangeDetectorTest.java +++ b/java/client/test/org/openqa/selenium/net/LinuxEphemeralPortRangeDetectorTest.java @@ -18,22 +18,13 @@ package org.openqa.selenium.net; import static org.assertj.core.api.Assertions.assertThat; -import static org.openqa.selenium.Platform.LINUX; -import org.junit.Assume; -import org.junit.BeforeClass; import org.junit.Test; -import org.openqa.selenium.Platform; import java.io.StringReader; public class LinuxEphemeralPortRangeDetectorTest { - @BeforeClass - public static void requiresLinux() { - Assume.assumeTrue(Platform.getCurrent().is(LINUX)); - } - @Test public void decodeEphemeralPorts() { String range ="1234 65533";
[java] Deleting a precondition, unit tests can run on any platform.
SeleniumHQ_selenium
train
java
0c3a13d290ad97e69f4e25651b14c6af41c98c50
diff --git a/aws/v4.go b/aws/v4.go index <HASH>..<HASH> 100644 --- a/aws/v4.go +++ b/aws/v4.go @@ -98,8 +98,8 @@ func (v4 *signer) sign() { } // add the new ones - v4.Request.Header.Add("Date", formatted) - v4.Request.Header.Add("Authorization", v4.authorization) + v4.Request.Header.Set("Date", formatted) + v4.Request.Header.Set("Authorization", v4.authorization) } func (v4 *signer) build() {
Set() don't Add() new Auth/Date headers in signer
aws_aws-sdk-go
train
go
c28c49c26eda22120a1672026de9557bfc3dc466
diff --git a/src/dialogs-wrapper.js b/src/dialogs-wrapper.js index <HASH>..<HASH> 100644 --- a/src/dialogs-wrapper.js +++ b/src/dialogs-wrapper.js @@ -98,7 +98,13 @@ export default function modalWrapperFactory (wrapperOptions) { }))) } - return h('transition-group', wrapperOptions.transition, renderedDialogs) + return h('transition-group', { + class: wrapperOptions.wrapper.class, + props: { + tag: wrapperOptions.wrapper.tag, + ...wrapperOptions.wrapper.transition + } + }, renderedDialogs) } }) }
fix: renderOptions being watched by vue
hjkcai_vue-modal-dialogs
train
js
6f46afb1786f5d489d3820c85c30a357c8fcd770
diff --git a/sos/plugins/manageiq.py b/sos/plugins/manageiq.py index <HASH>..<HASH> 100644 --- a/sos/plugins/manageiq.py +++ b/sos/plugins/manageiq.py @@ -71,7 +71,11 @@ class ManageIQ(Plugin, RedHatPlugin): self.add_copy_spec([ os.path.join(self.miq_log_dir, x) for x in self.miq_log_files ]) - self.add_copy_spec("/var/log/tower.log") + + self.add_copy_spec([ + "/var/log/tower.log", + "/etc/manageiq/postgresql.conf.d/*.conf" + ]) if environ.get("APPLIANCE_PG_DATA"): pg_dir = environ.get("APPLIANCE_PG_DATA")
[manageiq] add postresql configuration path The most recent version of CloudForms adds postgres configuration files at: /etc/managiq/postgresql.conf.d/ Include these in the set of files collected by the plugin. Resolves: #<I>
sosreport_sos
train
py
0a767bed7f4b3225f65e044023d4569076382a2a
diff --git a/src/toast/index.js b/src/toast/index.js index <HASH>..<HASH> 100644 --- a/src/toast/index.js +++ b/src/toast/index.js @@ -51,7 +51,12 @@ function createInstance() { // transform toast options to popup props function transformOptions(options) { + options = { ...options }; options.overlay = options.mask; + + delete options.mask; + delete options.duration; + return options; } diff --git a/src/toast/test/index.spec.js b/src/toast/test/index.spec.js index <HASH>..<HASH> 100644 --- a/src/toast/test/index.spec.js +++ b/src/toast/test/index.spec.js @@ -105,10 +105,11 @@ test('remove toast DOM when cleared in multiple mode', async () => { }); test('set default options', () => { - Toast.setDefaultOptions({ duration: 1000 }); - expect(Toast().duration).toEqual(1000); + const className = 'my-toast'; + Toast.setDefaultOptions({ className }); + expect(Toast().className).toEqual(className); Toast.resetDefaultOptions(); - expect(Toast().duration).toEqual(3000); + expect(Toast().className).toEqual(''); }); test('toast duration 0', () => {
[bugfix] Toast: incorrect overlay duration (#<I>)
youzan_vant
train
js,js
0d280479b2a7588ead5a699bed46b42b6ce38713
diff --git a/binder.go b/binder.go index <HASH>..<HASH> 100644 --- a/binder.go +++ b/binder.go @@ -122,6 +122,7 @@ func (binder FastBinder) RoundTrip(stdreq *http.Request) (*http.Response, error) if stdreq.ContentLength >= 0 { ctx.Request.Header.SetContentLength(int(stdreq.ContentLength)) } else { + ctx.Request.Header.SetContentLength(-1) ctx.Request.Header.Add("Transfer-Encoding", "chunked") } @@ -153,6 +154,8 @@ func std2fast(stdreq *http.Request) *fasthttp.Request { } } + fastreq.Header.SetContentLength(int(stdreq.ContentLength)) + return fastreq } @@ -175,7 +178,10 @@ func fast2std(stdreq *http.Request, fastresp *fasthttp.Response) *http.Response stdresp.Header.Add(sk, sv) }) - if fastresp.Header.ContentLength() == -1 { + if fastresp.Header.ContentLength() >= 0 { + stdresp.ContentLength = int64(fastresp.Header.ContentLength()) + } else { + stdresp.ContentLength = -1 stdresp.TransferEncoding = []string{"chunked"} }
Fix chunked encoding & content length on recent fasthttp
gavv_httpexpect
train
go
491f4700beae6b23351af3ba396b87b305b171d5
diff --git a/hibernate-ogm-mongodb/src/main/java/org/hibernate/ogm/dialect/mongodb/MongoDBAssociationSnapshot.java b/hibernate-ogm-mongodb/src/main/java/org/hibernate/ogm/dialect/mongodb/MongoDBAssociationSnapshot.java index <HASH>..<HASH> 100644 --- a/hibernate-ogm-mongodb/src/main/java/org/hibernate/ogm/dialect/mongodb/MongoDBAssociationSnapshot.java +++ b/hibernate-ogm-mongodb/src/main/java/org/hibernate/ogm/dialect/mongodb/MongoDBAssociationSnapshot.java @@ -132,6 +132,10 @@ public class MongoDBAssociationSnapshot implements AssociationSnapshot { return map.keySet(); } + public DBObject getAssoc() { + return this.assoc; + } + @Override public String toString() { final StringBuilder sb = new StringBuilder();
OGM-<I> Expose the object sent back by the datastore (used in the UT)
hibernate_hibernate-ogm
train
java
cf7fa8c54061e13c9267c31327b252954e02adae
diff --git a/itests/steps/marathon_steps.py b/itests/steps/marathon_steps.py index <HASH>..<HASH> 100644 --- a/itests/steps/marathon_steps.py +++ b/itests/steps/marathon_steps.py @@ -158,7 +158,7 @@ def stop_listening_stream(context): # and 2 deployment_step_success events filtered_events = [e for e in context.events if e.event_type == "deployment_success"] - assert len(filtered_events) == 1 + assert len(filtered_events) == 1, "We had %d filtered_events: %s" % (len(filtered_events), filtered_events) @then('we should be able to see a deployment')
Add some debug logic to the assert
thefactory_marathon-python
train
py
73df5ffbffdac6900b90a442a54c95a91d0a485e
diff --git a/multiqc/utils/util_functions.py b/multiqc/utils/util_functions.py index <HASH>..<HASH> 100644 --- a/multiqc/utils/util_functions.py +++ b/multiqc/utils/util_functions.py @@ -9,10 +9,11 @@ import os import yaml import time import shutil +import sys from multiqc import config -def robust_rmtree(path, logger=None, max_retries=5): +def robust_rmtree(path, logger=None, max_retries=10): """Robustly tries to delete paths. Retries several times (with increasing delays) if an OSError occurs. If the final attempt fails, the Exception is propagated @@ -25,9 +26,12 @@ def robust_rmtree(path, logger=None, max_retries=5): return except OSError: if logger: - logger.info('Unable to remove path: %s' % path) - logger.info('Retrying after %d seconds' % i) - time.sleep(i) + logger.info('Unable to remove path: {}'.format(path)) + logger.info('Retrying after {} seconds'.format(i**2)) + else: + print('Unable to remove path: {}'.format(path), file=sys.stderr) + print('Retrying after {} seconds'.format(i**2), file=sys.stderr) + time.sleep(i**2) # Final attempt, pass any Exceptions up to caller. shutil.rmtree(path)
Made the robust_rmtree more conservative. See #<I>.
ewels_MultiQC
train
py
4cb706a5eb41ff964899eb1522c45debcb3b2536
diff --git a/lib/generator.js b/lib/generator.js index <HASH>..<HASH> 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -193,7 +193,7 @@ function generateDoc(source, options) { 'href': url + '#L' + entry.getLineNumber(), 'member': member, 'name': entry.getName(), - 'separator': getSeparator(entry) + 'separator': member ? getSeparator(entry) : '' }) );
Only use a separator if in the entry template if there is a member.
jdalton_docdown
train
js
ed7f0c4a513cfd57040e3bebf83507233dcb1e92
diff --git a/app/libraries/Setups/Scripts/CustomizePreview.php b/app/libraries/Setups/Scripts/CustomizePreview.php index <HASH>..<HASH> 100644 --- a/app/libraries/Setups/Scripts/CustomizePreview.php +++ b/app/libraries/Setups/Scripts/CustomizePreview.php @@ -33,7 +33,7 @@ final class CustomizePreview extends AbstractScript 'url', '/dist/scripts/customize-preview.min.js' ), - ['jquery', 'customize-preview'], + ['customize-preview'], '', true ); diff --git a/tests/unit/libraries/Setups/Scripts/CustomizePreviewTest.php b/tests/unit/libraries/Setups/Scripts/CustomizePreviewTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/libraries/Setups/Scripts/CustomizePreviewTest.php +++ b/tests/unit/libraries/Setups/Scripts/CustomizePreviewTest.php @@ -73,7 +73,7 @@ class CustomizePreviewTest extends AbstractTestCase $wp_enqueue_script->wasCalledWithOnce([ $script->id, 'http://my.site/dist/scripts/customizer.js', - ['jquery', 'customize-preview'], + ['customize-preview'], '', true ]);
Remove 'jquery' as dependency of 'jentil-customize-preview' script Core's customize-preview script already lists jquery as dependency, so removing it from our jentil-customize-preview script should not cause any troubles; jquery will still be loaded before our own script.
GrottoPress_jentil
train
php,php
b55ef80701ed140adfaaaba836e1e27fc3837417
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 @@ -28,6 +28,6 @@ SimpleCov.start do add_filter '/spec/' end if ENV["COVERAGE"] -$logger = ZTK::Logger.new(Tempfile.new("test").path) +$logger = ZTK::Logger.new(File.join("/tmp", "test.log")) ################################################################################ diff --git a/spec/ztk/logger_spec.rb b/spec/ztk/logger_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ztk/logger_spec.rb +++ b/spec/ztk/logger_spec.rb @@ -31,7 +31,7 @@ describe ZTK::Logger do :error => "This is a test error message", :fatal => "This is a test fatal message" } - @logfile = Tempfile.new("logger").path + @logfile = File.join("/tmp", "logger.log") end before(:each) do
use specific filepaths for spec loggers
zpatten_ztk
train
rb,rb
8f4ed9e5415442186814cde14c66a3c41674decd
diff --git a/ara/api/serializers.py b/ara/api/serializers.py index <HASH>..<HASH> 100644 --- a/ara/api/serializers.py +++ b/ara/api/serializers.py @@ -20,7 +20,6 @@ import json import logging import zlib -from django.utils import timezone from rest_framework import serializers from ara.api import models @@ -70,7 +69,7 @@ class DurationSerializer(serializers.ModelSerializer): @staticmethod def get_duration(obj): if obj.ended is None: - return timezone.now() - obj.started + return obj.updated - obj.started return obj.ended - obj.started
Use playbook.updated instead of "now" for calculating duration Using now() to calculate the duration was not accurate. If a playbook had never ended, it would show that a playbook ran yesterday for ><I>k seconds and keep growing, for example. playbook.updated is the next best thing we've got so let's use that. Change-Id: I<I>c<I>d<I>e0a<I>f3da1dcbf<I>c7e8
ansible-community_ara
train
py
dd11ac300bccd5287031168cc859d85a638f4f3a
diff --git a/test/simple_oauth_test.rb b/test/simple_oauth_test.rb index <HASH>..<HASH> 100644 --- a/test/simple_oauth_test.rb +++ b/test/simple_oauth_test.rb @@ -132,4 +132,17 @@ class SimpleOAuthTest < Test::Unit::TestCase # Each of the three combined values should be URL encoded. assert_equal 'ME%23HOD&U%23L&NORMAL%23ZED_PARAMS', header.send(:signature_base) end + + def test_secret + header = SimpleOAuth::Header.new(:get, 'https://api.twitter.com/statuses/friendships.json', {}) + header.stubs(:options).returns(:consumer_secret => 'CONSUMER_SECRET', :token_secret => 'TOKEN_SECRET') + + # Should combine the consumer and token secrets with an ampersand. + assert_equal 'CONSUMER_SECRET&TOKEN_SECRET', header.send(:secret) + + header.stubs(:options).returns(:consumer_secret => 'CONSUM#R_SECRET', :token_secret => 'TOKEN_S#CRET') + + # Should URL encode each secret value before combination. + assert_equal 'CONSUM%23R_SECRET&TOKEN_S%23CRET', header.send(:secret) + end end
Test generation of the secret used for generating the OAuth signature.
laserlemon_simple_oauth
train
rb
13b4ef1d378b283dc725e78d5f1d5474fa020d2a
diff --git a/lib/auth_plugins/sha256_password.js b/lib/auth_plugins/sha256_password.js index <HASH>..<HASH> 100644 --- a/lib/auth_plugins/sha256_password.js +++ b/lib/auth_plugins/sha256_password.js @@ -2,7 +2,7 @@ const PLUGIN_NAME = 'sha256_password'; const crypto = require('crypto'); -const { xor } = require('../auth_41'); +const { xorRotating } = require('../auth_41'); const REQUEST_SERVER_KEY_PACKET = Buffer.from([1]); @@ -11,7 +11,7 @@ const STATE_WAIT_SERVER_KEY = 1; const STATE_FINAL = -1; function encrypt(password, scramble, key) { - const stage1 = xor( + const stage1 = xorRotating( Buffer.from(`${password}\0`, 'utf8').toString('binary'), scramble.toString('binary') );
Update sha<I>_password.js In short, replacing `xor` for `xorRotating` when authenticating passwords that are greater than <I> characters in length. The original issue was first spotted in the auth_plugin `caching_sha2_password` but is also present in the `sha<I>_password` auth_plugin as well. The link to the original issue (and fix) can be found here: <URL>
sidorares_node-mysql2
train
js
f482e8e776321e9774a42237c148819797d0c64a
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -435,7 +435,7 @@ func (c *Client) UserAuthServerCert() error { } fmt.Printf("Certificate fingerprint: % x\n", c.scertDigest) - fmt.Printf("ok (y/n)?") + fmt.Printf("ok (y/n)? ") line, err := ReadStdin() if err != nil { return err
Add a space between y/n prompt for cert validity
lxc_lxd
train
go
da2940f5935f5eacbf8f57ecb54adad2ea59de16
diff --git a/concrete/blocks/express_form/controller.php b/concrete/blocks/express_form/controller.php index <HASH>..<HASH> 100644 --- a/concrete/blocks/express_form/controller.php +++ b/concrete/blocks/express_form/controller.php @@ -824,6 +824,7 @@ class Controller extends BlockController implements NotificationProviderInterfac $this->set('expressForm', $form); } if ($this->displayCaptcha) { + $this->set('captcha', $this->app->make('helper/validation/captcha')); $this->requireAsset('css', 'core/frontend/captcha'); } $this->requireAsset('css', 'core/frontend/errors');
fixing captcha error in form view
concrete5_concrete5
train
php
7b8e7eca601d283be5c9a4f745f2652f1fa7b456
diff --git a/ape/installtools/__init__.py b/ape/installtools/__init__.py index <HASH>..<HASH> 100644 --- a/ape/installtools/__init__.py +++ b/ape/installtools/__init__.py @@ -34,11 +34,14 @@ def create_project_venv(): sys.exit() try: - call(['virtualenv', venv_dir, '--no-site-packages']) + r = call(['virtualenv', venv_dir, '--no-site-packages']) except OSError: print 'ERROR: You probably dont have virtualenv installed: sudo apt-get install python-virtualenv' sys.exit() + if r != 0: + raise Exception('ERROR: please install virtualenv in your current env.') + print '... virtualenv successfully created' return VirtualEnv(venv_dir)
added support for debian virtualenv issue described in issue #5
henzk_ape
train
py
c4a236e2607d277bae2cbd14aa0a0faf89b3de9b
diff --git a/lib/util/index.js b/lib/util/index.js index <HASH>..<HASH> 100644 --- a/lib/util/index.js +++ b/lib/util/index.js @@ -951,15 +951,19 @@ function decodePath(path) { function getRuleFiles(rule) { var files = rule.files || [getPath(getUrl(rule))]; var root = rule.root; - return files.map(function(file) { - var filename = ''; + var result = []; + files.map(function(file) { file = decodePath(file); + file = fileMgr.convertSlash(root ? join(root, file) : file); if (END_WIDTH_SEP_RE.test(file)) { - filename = 'index.html'; + result.push(file.slice(0, -1)); + file = root ? join(root, file, 'index.html') : join(file, 'index.html'); + result.push(fileMgr.convertSlash(file)); + } else { + result.push(file); } - file = root ? join(root, file, filename) : join(file, filename); - return fileMgr.convertSlash(file); }); + return result; } exports.getRuleFiles = getRuleFiles;
refactor: getPath
avwo_whistle
train
js
5f1eaf1e64d67a5d3d7433770a9bb69ff7197406
diff --git a/GPy/inference/SCG.py b/GPy/inference/SCG.py index <HASH>..<HASH> 100644 --- a/GPy/inference/SCG.py +++ b/GPy/inference/SCG.py @@ -39,8 +39,10 @@ def SCG(f, gradf, x, optargs=(), maxiters=500, max_f_eval=500, display=True, xto function_eval number of fn evaluations status: string describing convergence status """ - print " SCG" - print ' {0:{mi}s} {1:11s} {2:11s} {3:11s}'.format("I", "F", "Scale", "|g|", mi=len(str(maxiters))) + + if display: + print " SCG" + print ' {0:{mi}s} {1:11s} {2:11s} {3:11s}'.format("I", "F", "Scale", "|g|", mi=len(str(maxiters))) if xtol is None: xtol = 1e-6
Removed fisrt prints if display is off
SheffieldML_GPy
train
py
4d60ea616eff61262721176db6e77819a23f6dc2
diff --git a/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java b/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java index <HASH>..<HASH> 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java +++ b/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java @@ -237,8 +237,8 @@ public abstract class AbstractJdbc2ResultSetMetaData implements PGResultSetMetaD Statement stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery(sql.toString()); while (rs.next()) { - int table = rs.getInt(1); - int column = rs.getInt(2); + int table = (int)rs.getLong(1); + int column = (int)rs.getLong(2); String columnName = rs.getString(3); String tableName = rs.getString(4); String schemaName = rs.getString(5);
Fix ResultSetMetaData retrieval when the oid counter exceeds INT_MAX. Since Java doesn't have unsigned ints we retrieve the values as long and then truncate to int, so it may have a negative value. As reported by Owen Tran.
pgjdbc_pgjdbc
train
java
bafd672a7ff5c22c5b5a0d667184759c52c2625c
diff --git a/html/query.go b/html/query.go index <HASH>..<HASH> 100644 --- a/html/query.go +++ b/html/query.go @@ -106,9 +106,15 @@ func SelectAttr(n *html.Node, name string) (val string) { } // OutputHTML returns the text including tags name. -func OutputHTML(n *html.Node) string { +func OutputHTML(n *html.Node, self bool) string { var buf bytes.Buffer - html.Render(&buf, n) + if self { + html.Render(&buf, n) + } else { + for n := n.FirstChild; n != nil; n = n.NextSibling { + html.Render(&buf, n) + } + } return buf.String() } diff --git a/html/query_test.go b/html/query_test.go index <HASH>..<HASH> 100644 --- a/html/query_test.go +++ b/html/query_test.go @@ -66,7 +66,7 @@ func TestXPath(t *testing.T) { if strings.Index(InnerText(node), "Logo") > 0 { t.Fatal("InnerText() have comment node text") } - if strings.Index(OutputHTML(node), "Logo") == -1 { + if strings.Index(OutputHTML(node, true), "Logo") == -1 { t.Fatal("OutputHTML() shoud have comment node text") } }
feature: OutputHTML allow node itself output or not #9
antchfx_xmlquery
train
go,go
2c26a159991a3458cbe40f02117dfe4074bace27
diff --git a/eZ/Publish/API/Repository/Values/User/Policy.php b/eZ/Publish/API/Repository/Values/User/Policy.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Values/User/Policy.php +++ b/eZ/Publish/API/Repository/Values/User/Policy.php @@ -19,7 +19,6 @@ use eZ\Publish\API\Repository\Values\ValueObject; * @property-read mixed $roleId the role id this policy belongs to * @property-read string $module Name of module, associated with the Policy * @property-read string $function Name of the module function Or all functions with '*' - * @property-read mixed $originalId Original policy ID the policy was created from. * @property-read array $limitations an array of \eZ\Publish\API\Repository\Values\User\Limitation */ abstract class Policy extends ValueObject
EZP-<I>: Removed unused reference to virtual property
ezsystems_ezpublish-kernel
train
php
564d909f3ab78e74cb4e1ab3dca3a167097adfa0
diff --git a/libre/apps/data_drivers/exceptions.py b/libre/apps/data_drivers/exceptions.py index <HASH>..<HASH> 100644 --- a/libre/apps/data_drivers/exceptions.py +++ b/libre/apps/data_drivers/exceptions.py @@ -11,3 +11,7 @@ class LIBREError(ParseError): class LIBREValueError(LIBREError): pass + + +class LIBREFieldError(LIBREError): + pass
Add a new exception for field resultion errors
commonwealth-of-puerto-rico_libre
train
py
19401bf0fa877d6366b29a7cc6555106eafb58fd
diff --git a/lib/virtus/class_methods.rb b/lib/virtus/class_methods.rb index <HASH>..<HASH> 100644 --- a/lib/virtus/class_methods.rb +++ b/lib/virtus/class_methods.rb @@ -44,8 +44,8 @@ module Virtus # @api public def attribute(name, type, options = {}) attribute = Attribute.determine_type(type).new(name, options) - define_attribute_methods(attribute) - add_attribute(attribute) + virtus_define_attribute_methods(attribute) + virtus_add_attribute(attribute) self end @@ -98,7 +98,7 @@ module Virtus # @return [undefined] # # @api private - def define_attribute_methods(attribute) + def virtus_define_attribute_methods(attribute) attribute.define_reader_method(self) attribute.define_writer_method(self) include self::AttributeMethods @@ -111,7 +111,7 @@ module Virtus # @return [undefined] # # @api private - def add_attribute(attribute) + def virtus_add_attribute(attribute) attributes << attribute descendants.each { |descendant| descendant.attributes.reset } end
Prefixed private methods to prevent conflicts.
solnic_virtus
train
rb
d67ea8ccf166fda11b321a89b37abe26c3e8a078
diff --git a/src/Events/GetCalendarEventsListener.php b/src/Events/GetCalendarEventsListener.php index <HASH>..<HASH> 100644 --- a/src/Events/GetCalendarEventsListener.php +++ b/src/Events/GetCalendarEventsListener.php @@ -15,7 +15,6 @@ class GetCalendarEventsListener implements EventListenerInterface { return [ 'Calendars.Model.getCalendarEvents' => 'getCalendarEvents', - 'Calendars.Model.getCalendarEventInfo' => 'getCalendarEventInfo', ]; }
Removing obsolete event listeners (task #<I>)
QoboLtd_cakephp-calendar
train
php
17131f7a2a0352eaa718a5d08d861f817ca2c991
diff --git a/code/controller/CMSMain.php b/code/controller/CMSMain.php index <HASH>..<HASH> 100755 --- a/code/controller/CMSMain.php +++ b/code/controller/CMSMain.php @@ -497,6 +497,19 @@ JS; return $form; } + + public function currentPageID() { + $id = parent::currentPageID(); + + // Fall back to homepage record + if(!$id) { + $homepageSegment = RootURLController::get_homepage_link(); + $homepageRecord = DataObject::get_one('SiteTree', sprintf('"URLSegment" = \'%s\'', $homepageSegment)); + if($homepageRecord) $id = $homepageRecord->ID; + } + + return $id; + } //------------------------------------------------------------------------------------------// // Data saving handlers
MINOR Fall back to homepage record for CMSMain->PreviewLink()
silverstripe_silverstripe-siteconfig
train
php
686a1010fe3da44a476516d4260939b1abde0cd5
diff --git a/tests/src/main/java/com/hazelcast/simulator/tests/network/PayloadUtils.java b/tests/src/main/java/com/hazelcast/simulator/tests/network/PayloadUtils.java index <HASH>..<HASH> 100644 --- a/tests/src/main/java/com/hazelcast/simulator/tests/network/PayloadUtils.java +++ b/tests/src/main/java/com/hazelcast/simulator/tests/network/PayloadUtils.java @@ -7,10 +7,10 @@ import static java.lang.String.format; public final class PayloadUtils { - private static final ILogger LOGGER = Logger.getLogger(PayloadUtils.class); - public static final boolean COMPRESS_HEX_OUTPUT = true; + private static final ILogger LOGGER = Logger.getLogger(PayloadUtils.class); + private PayloadUtils() { }
Fixed CheckStyle issue in PayloadUtils.
hazelcast_hazelcast-simulator
train
java
38fcbfa3fdf61c1837d2a2c31be758441706eb01
diff --git a/services/price/server.py b/services/price/server.py index <HASH>..<HASH> 100644 --- a/services/price/server.py +++ b/services/price/server.py @@ -308,12 +308,12 @@ class PriceServicer(price_pb2_grpc.PriceServicer): def __init__(self): self.pymortar_client = pymortar.Client() - price_path = PRICE_DATA_PATH + "/" + "price_mapping.csv" - if not os.path.exists(price_path): + price_path = PRICE_DATA_PATH + "/" + "price-mapping.csv" + if not os.path.exists(str(price_path)): print("Error: could not find price_mapping.csv file.") - quit() + sys.exit() - self.price_mapping = pd.read_csv(price_path) + self.price_mapping = pd.read_csv(str(price_path)) def GetPrice(self, request, context): prices,error = get_price(request,self.pymortar_client)
updated price_mapping file location and fixed building names
SoftwareDefinedBuildings_XBOS
train
py
b988b2cf91c42b6ab4bcc8295367645bd5f13ad6
diff --git a/scapy.py b/scapy.py index <HASH>..<HASH> 100755 --- a/scapy.py +++ b/scapy.py @@ -6125,7 +6125,7 @@ class STP(Packet): ShortField("bridgeid", 0), MACField("bridgemac", ETHER_ANY), ShortField("portid", 0), - ShortField("age", 1), + BCDFloatField("age", 1), BCDFloatField("maxage", 20), BCDFloatField("hellotime", 2), BCDFloatField("fwddelay", 15) ]
Use BCDFloadField for STP age field (ticket #<I>)
secdev_scapy
train
py
28f2026618b94342574ab9b0ab726c9608c03d8e
diff --git a/examples/mpl/subplots.py b/examples/mpl/subplots.py index <HASH>..<HASH> 100644 --- a/examples/mpl/subplots.py +++ b/examples/mpl/subplots.py @@ -1,4 +1,3 @@ -from __future__ import print_function """ Edward Tufte uses this example from Anscombe to show 4 datasets of x and y that have the same mean, standard deviation, and regression @@ -49,7 +48,7 @@ plt.axis([2, 20, 2, 14]) plt.setp(plt.gca(), yticklabels=[], yticks=(4, 8, 12), xticks=(0, 10, 20)) plt.text(3, 12, 'IV', fontsize=20) -plt.title("Subplots support in Bokeh") +# We create the figure in matplotlib and then we "pass it" to Bokeh pyplot.show_bokeh(plt.gcf(), filename="subplots.html")
Fixed some unused imports and comments.
bokeh_bokeh
train
py
f5381e4f5a2a33a4d8740ac8f4536826d2962ba5
diff --git a/src/count-down/test/index.spec.js b/src/count-down/test/index.spec.js index <HASH>..<HASH> 100644 --- a/src/count-down/test/index.spec.js +++ b/src/count-down/test/index.spec.js @@ -1,4 +1,4 @@ -import { nextTick } from 'vue'; +import { KeepAlive, nextTick } from 'vue'; import CountDown from '..'; import { mount, later } from '../../../test'; @@ -178,11 +178,13 @@ test('should format S milliseconds correctly', () => { test('should pause counting when deactivated', async () => { const wrapper = mount({ - template: ` - <keep-alive> - <van-count-down v-if="render" ref="countDown" time="100" /> - </keep-alive> - `, + render() { + return ( + <KeepAlive> + {this.render ? <CountDown ref="countDown" time="10000" /> : null} + </KeepAlive> + ); + }, data() { return { render: true,
test(CountDown): fix test warning (#<I>)
youzan_vant
train
js
c5df76f6a5423466f9d63b73de2a1e07a95611c6
diff --git a/lib/Record.php b/lib/Record.php index <HASH>..<HASH> 100644 --- a/lib/Record.php +++ b/lib/Record.php @@ -346,6 +346,9 @@ class Record extends Base implements \ArrayAccess, \IteratorAggregate, \Countabl // Insert if ($isNew) { + if (array_key_exists($this->primaryKey, $this->data) && !$this->data[$this->primaryKey]) { + unset($this->data[$this->primaryKey]); + } $result = (bool)$this->db->insert($this->table, $this->data); if ($result) { $this->isNew = false;
try to fix db test error
twinh_wei
train
php
6eebcf0e04c6300ff644229907564cb74b7d73f9
diff --git a/pysat/tests/test_ftp_instruments.py b/pysat/tests/test_ftp_instruments.py index <HASH>..<HASH> 100644 --- a/pysat/tests/test_ftp_instruments.py +++ b/pysat/tests/test_ftp_instruments.py @@ -1,16 +1,13 @@ """ tests the pysat meta object and code """ -import pysat +import importlib +import os import tempfile - +import pysat import pysat.instruments.pysat_testing import pysat.tests.test_instruments -# import pysat.instruments as instruments -import os - -import importlib include_list = ['sw_dst', 'sw_kp'] # dict, keyed by pysat instrument, with a list of usernames and passwords
Update test_ftp_instruments.py Updated import order to be more PEP8 compliant
rstoneback_pysat
train
py
86c4258a72a019c271a9524be793c503ea78ebd8
diff --git a/mod/forum/lib.php b/mod/forum/lib.php index <HASH>..<HASH> 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1246,7 +1246,7 @@ function forum_get_readable_forums($userid, $courseid=0) { $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); - if (has_capability('moodle/course:viewhiddenactivities', $coursecontext)) { + if (!has_capability('moodle/course:viewhiddenactivities', $coursecontext)) { $selecthidden = ' AND cm.visible = 1'; } else { $selecthidden = '';
merged fixing a broken has_capability() call
moodle_moodle
train
php
6d8d6cdb57d03af2bdd1d86813ff2add733ce8fd
diff --git a/scripts/webpack/webpack.hot.js b/scripts/webpack/webpack.hot.js index <HASH>..<HASH> 100644 --- a/scripts/webpack/webpack.hot.js +++ b/scripts/webpack/webpack.hot.js @@ -26,6 +26,8 @@ module.exports = merge(common, { extensions: ['.scss', '.ts', '.tsx', '.es6', '.js', '.json', '.svg', '.woff2', '.png'], }, + devtool: 'eval-source-map', + devServer: { publicPath: '/public/build/', hot: true,
Fix sourcemaps for webpack hot config
grafana_grafana
train
js
d941916ccad93bb0f67ff8f3d498b58942b3965f
diff --git a/lib/rib/more/edit.rb b/lib/rib/more/edit.rb index <HASH>..<HASH> 100644 --- a/lib/rib/more/edit.rb +++ b/lib/rib/more/edit.rb @@ -13,9 +13,10 @@ module Rib::Edit file.puts(Rib.vars[:edit]) file.close - system("#{ENV['EDITOR']} #{file.path}") + shell = Rib.shell + system("#{shell.editor} #{file.path}") - if (shell = Rib.shell).running? + if shell.running? shell.send(:multiline_buffer).pop else shell.before_loop @@ -29,5 +30,9 @@ module Rib::Edit end end + def editor + ENV['EDITOR'] || 'vim' + end + Rib.extend(Imp) end
[rib/more/edit] default editor to vim, and you could override it
godfat_rib
train
rb
df06cb5f6f420236037730a73476f812b8b2ff9f
diff --git a/src/test/java/com/google/cloud/tools/managedcloudsdk/ManagedCloudSdkTest.java b/src/test/java/com/google/cloud/tools/managedcloudsdk/ManagedCloudSdkTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/google/cloud/tools/managedcloudsdk/ManagedCloudSdkTest.java +++ b/src/test/java/com/google/cloud/tools/managedcloudsdk/ManagedCloudSdkTest.java @@ -36,7 +36,7 @@ public class ManagedCloudSdkTest { @Rule public TemporaryFolder tempDir = new TemporaryFolder(); - private static final String FIXED_VERSION = "169.0.0"; + private static final String FIXED_VERSION = "174.0.0"; private final MessageCollector testListener = new MessageCollector(); private final SdkComponent testComponent = SdkComponent.APP_ENGINE_JAVA;
Fix cloud SDK test, bug in Cloud SDK doesn't allow downgrades to <I> (#<I>)
GoogleCloudPlatform_appengine-plugins-core
train
java
89f7a2740deaf047dc5fce0a5212b6b31c849f16
diff --git a/currencies/admin.py b/currencies/admin.py index <HASH>..<HASH> 100644 --- a/currencies/admin.py +++ b/currencies/admin.py @@ -3,7 +3,8 @@ from currencies.models import Currency class CurrencyAdmin(admin.ModelAdmin): - list_display = ("name", "is_default", "code", "symbol", "factor") + list_display = ("name", "is_active", "is_base", "is_default", "code", "symbol", "factor") + list_filter = ("is_active", ) search_fields = ("name", "code") admin.site.register(Currency, CurrencyAdmin)
Add is_active and is_base to the admin
bashu_django-simple-currencies
train
py
692f5184c405b3b0f9b6ac02c37aaefb7d2ffb62
diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -165,7 +165,7 @@ module ActionDispatch return response unless value cookie = { :value => value } - unless options[:expire_after].nil? + if options[:expire_after] cookie[:expires] = Time.now + options.delete(:expire_after) end
no need to check for nil?
rails_rails
train
rb
5e9eaf3e0f03b02e2c493fa44ada5601df8528b4
diff --git a/intranet/apps/eighth/views/api.py b/intranet/apps/eighth/views/api.py index <HASH>..<HASH> 100644 --- a/intranet/apps/eighth/views/api.py +++ b/intranet/apps/eighth/views/api.py @@ -1,6 +1,7 @@ import logging from datetime import datetime +from django.core.exceptions import PermissionDenied from django.http import Http404 from django.contrib.auth import get_user_model @@ -126,7 +127,9 @@ class EighthUserSignupListAdd(generics.ListCreateAPIView): return Response(serialized.data) def create(self, request, user_id=None): - if user_id: + if user_id and not request.user.is_eighth_admin: + raise PermissionDenied + elif user_id: user = get_user_model().objects.get(id=user_id) else: user = request.user
fix(eighth): deny unauthorized signup API request
tjcsl_ion
train
py
cf3ff1c37231c9d0874763ccd2439dce47de5be1
diff --git a/ntfy/backends/simplepush.py b/ntfy/backends/simplepush.py index <HASH>..<HASH> 100644 --- a/ntfy/backends/simplepush.py +++ b/ntfy/backends/simplepush.py @@ -4,7 +4,8 @@ from ..config import USER_AGENT def notify(title, message, - key): + key, + retcode=None): """ Required paramter: * ``key`` - The Simplepush identification key, created by
retcode argument for simplepush backend (ugh.. that's why i didn't _really_ dig the idea of that arg)
dschep_ntfy
train
py
1352d5e3933437a676daa333b828b1ec030f1523
diff --git a/lib/framer.js b/lib/framer.js index <HASH>..<HASH> 100644 --- a/lib/framer.js +++ b/lib/framer.js @@ -298,7 +298,7 @@ frame_types[0x1] = 'HEADERS'; frame_flags.HEADERS = ['END_STREAM', 'RESERVED', 'END_HEADERS', 'PRIORITY']; -type_specific_attributes.HEADERS = ['priority', 'data']; +type_specific_attributes.HEADERS = ['priority', 'headers', 'data']; // 0 1 2 3 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -497,7 +497,7 @@ frame_types[0x5] = 'PUSH_PROMISE'; frame_flags.PUSH_PROMISE = ['END_PUSH_PROMISE']; -type_specific_attributes.PUSH_PROMISE = ['promised_stream', 'data']; +type_specific_attributes.PUSH_PROMISE = ['promised_stream', 'headers', 'data']; // 0 1 2 3 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Framer: add 'headers' as frame specific attribute to HEADERS and PUSH_PROMISE.
molnarg_node-http2-protocol
train
js
92a66564068783b123538d3799eb2b710ee1c651
diff --git a/src/Ddeboer/DataImport/Reader/Factory/CsvReaderFactory.php b/src/Ddeboer/DataImport/Reader/Factory/CsvReaderFactory.php index <HASH>..<HASH> 100644 --- a/src/Ddeboer/DataImport/Reader/Factory/CsvReaderFactory.php +++ b/src/Ddeboer/DataImport/Reader/Factory/CsvReaderFactory.php @@ -19,7 +19,7 @@ class CsvReaderFactory public function __construct( $headerRowNumber = null, $strict = true, - $delimiter = ';', + $delimiter = ',', $enclosure = '"', $escape = '\\' ) {
Use commas for the CSV Reader Since CSV means comma separated values it seems only logical that its the default. A similar change was made against the CsvReader awhile back and I just noticed the CsvReaderFactory has the same issue.
portphp_portphp
train
php
7c0a7eac6e2903f786cdf298d12052af59c253a3
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -244,6 +244,8 @@ def build_hcurves_and_stats(pgetter, hstats, monitor): pmaps = pgetter.get_pmaps(pgetter.sids) except IndexError: # no data return {} + if sum(len(pmap) for pmap in pmaps) == 0: # no data + return {} pmap_by_kind = {} for kind, stat in hstats: with monitor('compute ' + kind):
Fixed build_hcurves_and_stats [skip hazardlib] [demos] Former-commit-id: <I>db<I>fb<I>f<I>e<I>b1babb<I>a<I>eb<I>ac
gem_oq-engine
train
py
ac6cc562b2788a128f8296266dd3f860073f99bc
diff --git a/dca/tl_page.php b/dca/tl_page.php index <HASH>..<HASH> 100644 --- a/dca/tl_page.php +++ b/dca/tl_page.php @@ -124,7 +124,7 @@ $GLOBALS['TL_DCA']['tl_page']['fields']['cookiebar_analyticsCheckbox'] = [ 'exclude' => true, 'inputType' => 'checkbox', 'eval' => ['tl_class' => 'clr'], - 'sql' => "char(1) NOT NULL default '1'", + 'sql' => "char(1) NOT NULL default ''", ]; $GLOBALS['TL_DCA']['tl_page']['fields']['cookiebar_analyticsLabel'] = [
Do not make the analytics checkbox set by default
codefog_contao-cookiebar
train
php
acc55190bb6be315f24504e75b1822e58c5c408b
diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -944,11 +944,10 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable { } /** - * Finds a descriptor from a collection by its class name. - * @deprecated Since we introduced {@link Descriptor#getId()}, it is a preferred method of identifying descriptor by a string. - * @since TODO + * Finds a descriptor from a collection by the class name of the {@link Descriptor}. + * This is useless as of the introduction of {@link #getId} and so only very old compatibility code needs it. */ - public static @CheckForNull <T extends Descriptor> T findByClassName(Collection<? extends T> list, String className) { + private static @CheckForNull <T extends Descriptor> T findByClassName(Collection<? extends T> list, String className) { for (T d : list) { if(d.getClass().getName().equals(className)) return d;
findByClassName should not be advertised to outside code. (cherry picked from commit 8dd<I>a8f<I>d3b<I>b4e<I>fc<I>ee5a<I>)
jenkinsci_jenkins
train
java
23d20c446f8a574e828936130c7590d10ae3665c
diff --git a/test/helpers.js b/test/helpers.js index <HASH>..<HASH> 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -3,7 +3,7 @@ import ParseError from "../src/ParseError"; import parseTree from "../src/parseTree"; import Settings from "../src/Settings"; -import diff from 'jest-diff'; +import {diff} from 'jest-diff'; import {RECEIVED_COLOR, printReceived, printExpected} from 'jest-matcher-utils'; import {formatStackTrace, separateMessageFromStack} from 'jest-message-util';
chore(tests): fix use of jest-diff (#<I>) Jest <I> changed the signature for jest-diff. This bug only arises from failing tests.
KaTeX_KaTeX
train
js
5399d20b6f91e1f24269265cc996268d2758b62b
diff --git a/schema/jsonschema.js b/schema/jsonschema.js index <HASH>..<HASH> 100755 --- a/schema/jsonschema.js +++ b/schema/jsonschema.js @@ -154,11 +154,11 @@ function traverse(schema, p) { params[key] = group+'{'+type+size+allowedValues+'} '+field+' '+description; var subs = {}; - var subgroup = p ? p+'.' : ''; + //var subgroup = p ? p+'.' : ''; // TODO apidoc - groups cannot have `.` in them if (param.type === 'array' && param.items.type === 'object') { - subs = traverse(param.items, subgroup+key+'[]'); + subs = traverse(param.items, key+'[]'); // subgroup+ } else if (param.type === 'object') { - subs = traverse(param, subgroup+key); + subs = traverse(param, key); // subgroup+ } for(var subKey in subs) { if (!subs.hasOwnProperty(subKey)) { continue; }
Bug fix. groups don't allow `.` in the name.
willfarrell_apidoc-plugin-schema
train
js
d6ac30c584e7183dbcc2f43e1fa8bce8315d3431
diff --git a/pypot/dynamixel/motor.py b/pypot/dynamixel/motor.py index <HASH>..<HASH> 100644 --- a/pypot/dynamixel/motor.py +++ b/pypot/dynamixel/motor.py @@ -255,7 +255,7 @@ class DxlMotor(Motor): elif control == 'dummy': dp = abs(self.present_position - position) - speed = (dp / float(duration)) if duration > 0 else numpy.inf + speed = (dp / float(duration)) if duration > 0 else 0 self.moving_speed = speed self.goal_position = position
Update motor.py np.inf is casted in Infinity in Json, which is not valid
poppy-project_pypot
train
py
9d3be396bd23ba2b7bc56e0acac096f7a9119c23
diff --git a/src/Configuration.php b/src/Configuration.php index <HASH>..<HASH> 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -91,6 +91,10 @@ final class Configuration */ public function setRecipientOverride($recipientOverride) { + if (!$recipientOverride) { + return $this; + } + if (!filter_var($recipientOverride, FILTER_VALIDATE_EMAIL)) { throw new Exception('Recipient override must be a valid email address'); } diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index <HASH>..<HASH> 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -78,6 +78,17 @@ final class ConfigurationTest extends PHPUnit_Framework_TestCase /** * @test */ + public function it_ignores_an_empty_recipient_override() + { + $config = Configuration::newInstance() + ->setRecipientOverride(null); + + $this->assertSame('', $config->getRecipientOverride()); + } + + /** + * @test + */ public function it_states_that_Gmail_style_overriding_should_be_done_when_configured_so() { $config = Configuration::newInstance()
Ignore empty recipient override
f500_swiftmailer-sparkpost
train
php,php
7e7b8a19408655febea8598d1eda0df780e55a2f
diff --git a/routing/router.go b/routing/router.go index <HASH>..<HASH> 100644 --- a/routing/router.go +++ b/routing/router.go @@ -727,6 +727,13 @@ func (r *ChannelRouter) pruneZombieChans() error { } } + // With the channels pruned, we'll also attempt to prune any nodes that + // were a part of them. + err = r.cfg.Graph.PruneGraphNodes() + if err != nil && err != channeldb.ErrGraphNodesNotFound { + return fmt.Errorf("unable to prune graph nodes: %v", err) + } + return nil }
routing: prune graph nodes after pruning zombie channels We do this to ensure we don't leave any stray nodes in our graph that were part of the zombie channels that we've pruned.
lightningnetwork_lnd
train
go
c4ceb5da226877857f7768a12060b71628a515cf
diff --git a/gct.py b/gct.py index <HASH>..<HASH> 100644 --- a/gct.py +++ b/gct.py @@ -17,7 +17,7 @@ __status__ = 'Beta' GCT Tools Tools for loading a GCT file and working with its contents as a Pandas DataFrame. -Compatible with Python 2.7 and Python 3.4 +Compatible with Python 2.7 and Python 3.4+ """ diff --git a/gp.py b/gp.py index <HASH>..<HASH> 100644 --- a/gp.py +++ b/gp.py @@ -3,9 +3,10 @@ __copyright__ = 'Copyright 2015-2016, Broad Institute' __version__ = '1.2.0' __status__ = 'Production' -""" GenePattern Python Client +""" +GenePattern Python Client - Compatible with Python 2.7 and Python 3.4 +Compatible with Python 2.7 and Python 3.4+ """ diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name='genepattern-python', - py_modules=['gp'], + py_modules=['gp', 'gct'], version='1.2.0', description='Library for programmatically interacting with GenePattern from Python.', author='Thorin Tabor',
Ship GCT Tools with the genepattern-python package
genepattern_genepattern-python
train
py,py,py
a045644c61dd14b75cbec05d7a571269acbbe4d9
diff --git a/multiqc/templates/default/assets/js/multiqc_generalstats.js b/multiqc/templates/default/assets/js/multiqc_generalstats.js index <HASH>..<HASH> 100644 --- a/multiqc/templates/default/assets/js/multiqc_generalstats.js +++ b/multiqc/templates/default/assets/js/multiqc_generalstats.js @@ -99,7 +99,7 @@ $(function () { if(colscheme_rev){ scale = chroma.scale(colscheme).domain([maxval, minval]); } - table.find('tr td:nth-of-type('+(idx)+')').each(function(){ + table.find('tr td:nth-of-type('+(idx+1)+')').each(function(){ var val = parseFloat($(this).text()); var col = scale(val).css(); $(this).find('.wrapper .bar').css('background-color', col);
Fixed JS index bug in general stats colours.
ewels_MultiQC
train
js
449db030f46385ba215d4d13cd5132c2af84c2b6
diff --git a/indra/tests/test_preassembler.py b/indra/tests/test_preassembler.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_preassembler.py +++ b/indra/tests/test_preassembler.py @@ -415,7 +415,7 @@ def test_render_stmt_graph(): stmts = [p0, p1, p2, p3, p4, p5, p6] pa = Preassembler(hierarchies, stmts=stmts) pa.combine_related() - graph = render_stmt_graph(pa.related_stmts) + graph = render_stmt_graph(pa.related_stmts, reduce=False) # One node for each statement assert len(graph.nodes()) == 7 # Edges:
Fix failing test for render_stmt_graph
sorgerlab_indra
train
py
c7bed7e2bec71086f7d548f6a8e9eaf757f6cb35
diff --git a/nodeserver/src/client/js/cli3nt.js b/nodeserver/src/client/js/cli3nt.js index <HASH>..<HASH> 100644 --- a/nodeserver/src/client/js/cli3nt.js +++ b/nodeserver/src/client/js/cli3nt.js @@ -404,6 +404,39 @@ define(['/common/LogManager.js','/common/EventDispatcher.js', '/socket.io/socket but only through functions this way all modifications will be visible */ + ClientNode = function(client,id,storage){ + var selfdata, + ; + /*public funcitons*/ + this.isDeleted = function(){ + return selfdata === null; + }; + this.getParentId = function(){ + return selfdata.relations.parentId; + }; + this.getChildrenIds = function(){ + return selfdata.relations.childrenIds; + }; + this.getBaseId = function(){ + return selfdata.relations.baseId; + }; + this.getInheritorIds = function(){ + return selfdata.relations.inheritorIds; + }; + this.getAttribute = function(name){ + + }; + this.getRegistry = function(name){ + + }; + + /*private functions*/ + + + /*main*/ + selfdata = storage.get(id); + + }; ClientNode = function(_client,_id,_storage){ /*public interface*/
continue 're-implementing' client side Former-commit-id: 2abfdc5df2f<I>e<I>d<I>a7
webgme_webgme-engine
train
js
f985028bcca353b3f873fc194c45eda4286b827b
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -149,5 +149,9 @@ module ActiveSupport alias :assert_not_same :refute_same ActiveSupport.run_load_hooks(:active_support_test_case, self) + + def inspect # :nodoc: + "#<#{self.class.name}:#{'%#016x' % object_id}>" + end end end
Stop gap solution for long output on test cases This patch just changes the inspect method on test case instances. Seeing test instance internals probably isn't helpful when an exception is raised (for example a `NoMethodError`). This isn't as good as #<I>, but should fix #<I>
rails_rails
train
rb
0ab8e215f6cc0596a0678d63f69eb9f114b03c14
diff --git a/shutit_srv.py b/shutit_srv.py index <HASH>..<HASH> 100644 --- a/shutit_srv.py +++ b/shutit_srv.py @@ -66,7 +66,6 @@ def update_modules(to_build, cfg): orig_mod_cfg[sec][key] = val for mid in orig_mod_cfg: shutit.cfg[mid].update(orig_mod_cfg[mid]) - shutit.cfg['repository'].update(orig_mod_cfg['repository']) shutit_main.config_collection_for_built(shutit) selected = set(to_build)
I'm <I>% sure this is redundant
ianmiell_shutit
train
py
74d09361c08d2ae375afc88819eb5dc212488818
diff --git a/src/sap.ui.layout/src/sap/ui/layout/ResponsiveSplitter.js b/src/sap.ui.layout/src/sap/ui/layout/ResponsiveSplitter.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.layout/src/sap/ui/layout/ResponsiveSplitter.js +++ b/src/sap.ui.layout/src/sap/ui/layout/ResponsiveSplitter.js @@ -564,7 +564,7 @@ sap.ui.define([ */ ResponsiveSplitter.prototype._clearContent = function () { this._aPaneContainers.forEach(function(oPaneContainer) { - oPaneContainer._oSplitter.removeAllAssociatedContentArea(); + oPaneContainer._oSplitter.removeAllAssociatedContentAreas(); }); this._aPaneContainers = [];
[INTERNAL] sap.ui.layout.ResponsiveSplitter: Replaced deprecated method Replaced depracated removeAllAssociatedContentArea (singular) with removeAllAssociatedContentAreas (plural) usage to prevent warnings in the console. Change-Id: I<I>b<I>d<I>d8afb<I>e<I>c<I>b<I>d<I>f
SAP_openui5
train
js
b25f7573a6b1456ca8c6dde004f302446cc59c29
diff --git a/src/CacheKey.php b/src/CacheKey.php index <HASH>..<HASH> 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -177,7 +177,11 @@ class CacheKey $value = $this->getTypeClause($where); $value .= $this->getValuesClause($where); - return "-{$where["column"]}_{$value}"; + $column = ""; + $column .= isset($where["column"]) ? $where["column"] : ""; + $column .= isset($where["columns"]) ? implode("-", $where["columns"]) : ""; + + return "-{$column}_{$value}"; } protected function getQueryColumns(array $columns) : string @@ -231,7 +235,7 @@ class CacheKey protected function getTypeClause($where) : string { - $type = in_array($where["type"], ["InRaw", "In", "NotIn", "Null", "NotNull", "between", "NotInSub", "InSub", "JsonContains"]) + $type = in_array($where["type"], ["InRaw", "In", "NotIn", "Null", "NotNull", "between", "NotInSub", "InSub", "JsonContains", "Fulltext"]) ? strtolower($where["type"]) : strtolower($where["operator"]);
Support for full text search Recently Laravel added support for full-text search where clauses in the query builder. <URL>
GeneaLabs_laravel-model-caching
train
php
92226e963ca6838d5e38f76b47cd8b047e3f296a
diff --git a/src/Common/Service/Database.php b/src/Common/Service/Database.php index <HASH>..<HASH> 100644 --- a/src/Common/Service/Database.php +++ b/src/Common/Service/Database.php @@ -60,7 +60,7 @@ use Nails\Testing; * @method \CI_DB_query_builder offset($offset) * @method \CI_DB_query_builder set($key, $value = '', $escape = null) * @method string get_compiled_select($table = '', $reset = true) - * @method \CI_DB_query_builder get($table = '', $limit = null, $offset = null) + * @method \CI_DB_result get($table = '', $limit = null, $offset = null) * @method int count_all_results($table = '', $reset = true) * @method \CI_DB_result get_where($table = '', $where = null, $limit = null, $offset = null) * @method int insert_batch($table, $set = null, $escape = null, $batch_size = 100)
Correct typehint in docblock
nails_common
train
php
38c34f324e52b79214d2ab117fcd1ea31a1eeebc
diff --git a/templates/js/atk4_univ.js b/templates/js/atk4_univ.js index <HASH>..<HASH> 100644 --- a/templates/js/atk4_univ.js +++ b/templates/js/atk4_univ.js @@ -447,6 +447,9 @@ ajaxec: function(url,data,fn){ newWindow: function(url,name,options){ window.open(url,name,options); }, +expr: function(str){ + return eval("(" + str + ")"); +}, loadingInProgress: function(){ this.successMessage('Loading is in progress. Please wait'); },
Added option to pass expression through jQuery chain Example: $this->js(true)->css("height", $this->js()->expr($this->js()->_selector("body")->innerHeight() . " - <I>"));
atk4_atk4
train
js
d59ef979773a1fb251dcfb4e96bcf24e4dccf27c
diff --git a/shell/src/main/java/tachyon/shell/TfsShell.java b/shell/src/main/java/tachyon/shell/TfsShell.java index <HASH>..<HASH> 100644 --- a/shell/src/main/java/tachyon/shell/TfsShell.java +++ b/shell/src/main/java/tachyon/shell/TfsShell.java @@ -116,7 +116,6 @@ public class TfsShell implements Closeable { System.out.println(" [mv <src> <dst>]"); System.out.println(" [pin <path>]"); System.out.println(" [report <path>]"); - System.out.println(" [request <tachyonaddress> <dependencyId>]"); System.out.println(" [rm <path>]"); System.out.println(" [rmr <path>]"); System.out.println(" [setTTL <path> <time to live(in milliseconds)>]");
Remove unused request command from shell help.
Alluxio_alluxio
train
java
4f9a419d77f627cdd1d515170182a5c393591b93
diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceContainer.java b/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceContainer.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceContainer.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceContainer.java @@ -151,7 +151,7 @@ public final class ClusteredServiceContainer implements AutoCloseable /** * Stream id within a channel for timer scheduling messages to the cluster. Default to stream id of 4. */ - public static final int TIMER_STREAM_ID_DEFAULT = 4; + public static final int TIMER_STREAM_ID_DEFAULT = 5; /** * Whether to start without any previous log or use any existing log.
[Java]: avoid replay stream Id conflicting with timer stream id
real-logic_aeron
train
java
868586c88326e70ede776448c5e96aaf83ae4b24
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import os -from setuptools import setup +from setuptools import setup, find_packages LONG_DESCRIPTION = """Django-Prometheus @@ -12,7 +12,7 @@ instructions. setup( name="django-prometheus", - version="0.1.1", + version="0.2.0", author="Uriel Corfa", author_email="uriel@corfa.fr", description=( @@ -20,7 +20,7 @@ setup( license="Apache", keywords="django monitoring prometheus", url="http://github.com/korfuri/django-prometheus", - packages=["django_prometheus"], + packages=find_packages(), test_suite="tests", long_description=LONG_DESCRIPTION, install_requires=[
Release <I> Previous releases did not package the database backends.
korfuri_django-prometheus
train
py
5dc6f28eaddf5f388368a6e6356e135ec780008e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( packages=['table'], include_package_data=True, license='BSD License', # example license - description='A simple Django app to conduct Web-based polls.', + description='A simple Django app to origanize data in tabular form.', long_description=README, url='http://www.example.com/', author='guoqs',
update app desc in setup.py
shymonk_django-datatable
train
py
439d0c4677016fcc6856708c07ab615d53db5147
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ import os from functools import partial from pip.req import parse_requirements -from setuptools import setup +from setuptools import setup, find_packages # parse_requirements() interface has changed in Pip 6.0 if pip.__version__ >= '6.0': @@ -50,6 +50,6 @@ setup( url = 'https://github.com/NiklasRosenstein/py-nr', author = 'Niklas Rosenstein', author_email = 'rosensteinniklas@gmail.com', - packages = ['nr'], + packages = find_packages(), install_requires = [str(x.req) for x in parse_requirements('requirements.txt')], )
fix packages listed in setup.py
NiklasRosenstein-Python_nr-deprecated
train
py
63c73a58a5700da9abeb68dbd0f8001fd0ebfd1c
diff --git a/pkg/api/v1/conversion.go b/pkg/api/v1/conversion.go index <HASH>..<HASH> 100644 --- a/pkg/api/v1/conversion.go +++ b/pkg/api/v1/conversion.go @@ -44,7 +44,7 @@ func addConversionFuncs() { "status.phase", "spec.nodeName": return label, value, nil - // This is for backwards compatability with old v1 clients which send spec.host + // This is for backwards compatability with old v1 clients which send spec.host case "spec.host": return "spec.nodeName", value, nil default:
Fix gofmt from #<I>
kubernetes_kubernetes
train
go
743722075b1fc77256d424779caca7a41a7364c8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -61,6 +61,9 @@ Mode.prototype.valueOf = function () { /** * Returns a String representation of the `mode`. + * The output resembles something similiar to what `ls -l` would output. + * + * http://en.wikipedia.org/wiki/Unix_file_types * * @return {String} * @api public
index: add link to the wikipedia "unix file types"
TooTallNate_stat-mode
train
js
f299b67532fff5051e254b7ec96065121980b94e
diff --git a/lib/html/pipeline/sanitization_filter.rb b/lib/html/pipeline/sanitization_filter.rb index <HASH>..<HASH> 100644 --- a/lib/html/pipeline/sanitization_filter.rb +++ b/lib/html/pipeline/sanitization_filter.rb @@ -1,8 +1,4 @@ -begin - require "sanitize" -rescue LoadError => _ - raise HTML::Pipeline::MissingDependencyError, "Missing dependency 'sanitize' for SanitizationFilter. See README.md for details." -end +HTML::Pipeline.require_dependency("sanitize", "SanitizationFilter") module HTML class Pipeline
require dependency for SanitizationFilter
jch_html-pipeline
train
rb
0b2dcaa13f0d6ee50a33fb26e908f30bb0421fde
diff --git a/lib/Widget/Validator/File.php b/lib/Widget/Validator/File.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Validator/File.php +++ b/lib/Widget/Validator/File.php @@ -433,7 +433,7 @@ class File extends AbstractValidator $file = basename($this->originFile); // Use substr instead of pathinfo, because pathinfo may return error value in unicode if (false !== $pos = strrpos($file, '.')) { - $this->ext = substr($file, $pos + 1); + $this->ext = strtolower(substr($file, $pos + 1)); } else { $this->ext = ''; }
fixed file extension is case insensitive in file validtor and upload widget, close #<I>
twinh_wei
train
php
f48a56510b46ad83d601632e2250ea7470308058
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ license: GNU-GPL2 from setuptools import setup setup(name='pyprofiler', - version='62', + version='63', description='Profiler utility for python, graphical and textual, whole program or segments', url='https://github.com/erikdejonge/pyprofiler', author='Erik de Jonge',
Monday <I> August <I> (week:<I> day:<I>), <I>:<I>:<I>
erikdejonge_pyprofiler
train
py
4ea153d59d04fc2c7c2c98522714e25d02751df5
diff --git a/JSAT/test/jsat/clustering/kmeans/XMeansTest.java b/JSAT/test/jsat/clustering/kmeans/XMeansTest.java index <HASH>..<HASH> 100644 --- a/JSAT/test/jsat/clustering/kmeans/XMeansTest.java +++ b/JSAT/test/jsat/clustering/kmeans/XMeansTest.java @@ -8,6 +8,8 @@ import java.util.concurrent.Executors; import jsat.SimpleDataSet; import jsat.classifiers.DataPoint; import jsat.clustering.SeedSelectionMethods; +import jsat.distributions.Normal; +import jsat.distributions.TruncatedDistribution; import jsat.distributions.Uniform; import jsat.linear.distancemetrics.EuclideanDistance; import jsat.utils.GridDataGenerator; @@ -39,8 +41,8 @@ public class XMeansTest @BeforeClass public static void setUpClass() { - GridDataGenerator gdg = new GridDataGenerator(new Uniform(0.0, 0.10), new XORWOW(), 2, 2); - easyData10 = gdg.generateData(50); + GridDataGenerator gdg = new GridDataGenerator(new TruncatedDistribution(new Normal(0, 0.05), -.15, .15), new XORWOW(), 2, 2); + easyData10 = gdg.generateData(100); ex = Executors.newFixedThreadPool(SystemInfo.LogicalCores); }
Improved test reliability by making the distribution better behaved and match what XMeans assumes
EdwardRaff_JSAT
train
java
b9b4deed9c4c3105884df49edfddf3d9574b3e44
diff --git a/django_webmap_corpus/tests/south_settings.py b/django_webmap_corpus/tests/south_settings.py index <HASH>..<HASH> 100644 --- a/django_webmap_corpus/tests/south_settings.py +++ b/django_webmap_corpus/tests/south_settings.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ These settings are used by the ``manage.py`` command.
add unicode to south_settings
auto-mat_django-webmap-corpus
train
py
3e16c544400bf1098ba22b976a90a97491902a4e
diff --git a/lib/verku/version.rb b/lib/verku/version.rb index <HASH>..<HASH> 100644 --- a/lib/verku/version.rb +++ b/lib/verku/version.rb @@ -1,5 +1,5 @@ module Verku - VERSION = '0.9.0.pre41' + VERSION = '0.9.0.pre42' # module Version # MAJOR = 0 # MINOR = 9
Bump to <I>.pre<I>
Merovex_verku
train
rb
09a23a1082d787c678a91e76be491d68deab6184
diff --git a/src/validator.js b/src/validator.js index <HASH>..<HASH> 100644 --- a/src/validator.js +++ b/src/validator.js @@ -54,7 +54,8 @@ function checkAnchor(dom, sourcefile, destinationPath, files) { function checkStatics(dom, sourcefile, destinationPath, files) { const validatableImage = image => !image.attribs.src.startsWith('http://') && - !image.attribs.src.startsWith('https://'); + !image.attribs.src.startsWith('https://') && + !image.attribs.src.startsWith('//'); const images = select(dom, 'img[src]'); images
fix: ignore images with protocol relative src
sinnerschrader_schlump
train
js
027b28d60464046f96a37d9264107e2d4ab5d614
diff --git a/cli.js b/cli.js index <HASH>..<HASH> 100755 --- a/cli.js +++ b/cli.js @@ -6,11 +6,12 @@ var path = require('path') var prog = path.resolve(process.argv[2]) console.log('probing program', prog) -console.log('kill -SIGUSR1', process.pid, 'for logging') var nodeArgs = [ '-r', path.join(__dirname, 'include.js') ] var nodeOpts = { stdio: 'inherit' } -spawn('node', nodeArgs.concat(prog), nodeOpts) +var child = spawn('node', nodeArgs.concat(prog), nodeOpts) + +console.log('kill -SIGUSR1', child.pid, 'for logging') diff --git a/include.js b/include.js index <HASH>..<HASH> 100644 --- a/include.js +++ b/include.js @@ -1,3 +1,3 @@ var why = require('./') -process.on('SIGUSR1', why) +process.on('SIGUSR1', function() { why() })
Fix CLI reporting the wrong PID and causing logging to fail on SIGUSR1 (#<I>) * Fix not reporting the child process PID * Fix 'SIGUSR1' being passed as the logger
mafintosh_why-is-node-running
train
js,js
a8a94384c2618ff517e8fa36753ff9e364149a43
diff --git a/lib/xcresources/builder/resources_builder.rb b/lib/xcresources/builder/resources_builder.rb index <HASH>..<HASH> 100644 --- a/lib/xcresources/builder/resources_builder.rb +++ b/lib/xcresources/builder/resources_builder.rb @@ -103,9 +103,9 @@ class XCResources::ResourcesBuilder < XCResources::FileBuilder struct.section do |section_struct| enumerate_keys.call do |key, value, comment| if documented? - section_struct.writeln "/// %s" % (comment || value) #unless comment.nil? + section_struct.writeln '/// %s' % (comment || value) #unless comment.nil? end - section_struct.writeln "__unsafe_unretained NSString *%s;" % key + section_struct.writeln '__unsafe_unretained NSString *%s;' % key end end struct.writeln '} %s;' % section_key
[CodeStyle] Use single quotes instead of double quotes
xcres_xcres
train
rb
815152d39489c3c5189884d499ecacec2bbd3137
diff --git a/tasks/lib/hooks/notify-fail.js b/tasks/lib/hooks/notify-fail.js index <HASH>..<HASH> 100644 --- a/tasks/lib/hooks/notify-fail.js +++ b/tasks/lib/hooks/notify-fail.js @@ -9,6 +9,8 @@ module.exports = function(grunt, options) { + var message_count = 0; + var StackParser = require('stack-parser'); var notify = require('../notify-lib'); @@ -45,6 +47,8 @@ module.exports = function(grunt, options) { */ function notifyHook(e) { + message_count++; + var message; if (!options.enabled) { @@ -67,7 +71,10 @@ module.exports = function(grunt, options) { message = e; } - //grunt.log.ok('!!!!!!', message); + if (message_count > 0 && message === 'Aborted due to warnings.') { + // skip unhelpful message because there was probably another one that was more helpful + return; + } return notify({ title: options.title + (grunt.task.current.nameArgs ? ' ' + grunt.task.current.nameArgs : ''),
don't show 'Aborted due to warnings.' when a more helpful message was displayed.
ryanpardieck_grunt-notify-chrome
train
js
ed954485239ad88f94bcee80a6a648d7943932f8
diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index <HASH>..<HASH> 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -584,6 +584,11 @@ class ComposerRepository extends ArrayRepository $filename = $this->baseUrl.'/'.$filename; } + // url-encode $ signs in URLs as bad proxies choke on them + if ($pos = strpos($filename, '$')) { + $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos+1); + } + $retries = 3; while ($retries--) { try {
URL-encode dollar signs to work around bad proxy failures
composer_composer
train
php
5abdbb2a040880a12e0660639543228029ec3290
diff --git a/lib/global_id/uri/gid.rb b/lib/global_id/uri/gid.rb index <HASH>..<HASH> 100644 --- a/lib/global_id/uri/gid.rb +++ b/lib/global_id/uri/gid.rb @@ -89,7 +89,7 @@ module URI def to_s # Implement #to_s to avoid no implicit conversion of nil into string when path is nil - "gid://#{app}#{path_query}" + "gid://#{app}#{path}#{'?' + query if query}" end protected
Avoid using internal path_query method.
rails_globalid
train
rb
0b9b70c82da4adba5b1237bfccfc7310a7238485
diff --git a/src/Popover/components/ContentWrapper.js b/src/Popover/components/ContentWrapper.js index <HASH>..<HASH> 100644 --- a/src/Popover/components/ContentWrapper.js +++ b/src/Popover/components/ContentWrapper.js @@ -48,6 +48,7 @@ const StyledPopoverParent = styled.div` padding-top: ${({ theme, noPadding }) => (noPadding ? 0 : theme.orbit.spaceMedium)}; box-shadow: ${({ theme }) => theme.orbit.boxShadowElevatedLevel1}; overflow: hidden; + z-index: 1000; &:focus { outline: 0; @@ -82,6 +83,7 @@ const StyledOverlay = styled.div` height: 100%; background-color: rgba(23, 27, 30, 0.6); // TODO: token animation: ${opacityAnimation} ${({ theme }) => theme.orbit.durationFast} ease-in; + z-index: 999; ${media.largeMobile(css` background-color: transparent;
FIX: Popover z-index (#<I>)
kiwicom_orbit-components
train
js
7faba21433cc08c6e0e29b14159c2c15a68b11c6
diff --git a/lib/virtualbox/vm.rb b/lib/virtualbox/vm.rb index <HASH>..<HASH> 100644 --- a/lib/virtualbox/vm.rb +++ b/lib/virtualbox/vm.rb @@ -578,9 +578,10 @@ module VirtualBox media = interface.unregister(:full) if !media.empty? - if Platform.windows? && !Platform.jruby? + if Platform.windows? # The MSCOM interface in CRuby to delete media is broken, - # so we do this ghettoness. + # so we do this ghettoness. Also, in JRuby, passing an array + # to objects is broken. So once again, we do this. path = interface.settings_file_path # A simple sanity check to make sure we don't attempt to delete @@ -589,8 +590,6 @@ module VirtualBox Pathname.new(path).parent.rmtree end else - # NOTE: This doesn't work on JRuby because passing an array as - # an argument to a method doesn't work... interface.delete(media) # TODO: This sleep is silly. The progress object returned by the media
Fix longstanding JRuby stack trace issue
mitchellh_virtualbox
train
rb
ea7c4e3407de58eb8c74a529b0ce23bae1671945
diff --git a/test/unexpectedMitm.js b/test/unexpectedMitm.js index <HASH>..<HASH> 100644 --- a/test/unexpectedMitm.js +++ b/test/unexpectedMitm.js @@ -2126,6 +2126,13 @@ describe('unexpectedMitm', () => { ); } )); + + it('should not break when the assertion being delegated to throws synchronously', () => + expect( + expect('http://www.google.com/', 'with http recorded', 'to foobarquux'), + 'to be rejected with', + /^Unknown assertion 'to foobarquux'/ + )); }); describe('in injecting mode against a local HTTP server', () => {
Add a test case for sync throw in "with http recorded".
unexpectedjs_unexpected-mitm
train
js
229e1015aa3213a372c704e925684bc714b78727
diff --git a/concrete/controllers/single_page/dashboard/users/attributes.php b/concrete/controllers/single_page/dashboard/users/attributes.php index <HASH>..<HASH> 100644 --- a/concrete/controllers/single_page/dashboard/users/attributes.php +++ b/concrete/controllers/single_page/dashboard/users/attributes.php @@ -39,7 +39,7 @@ class Attributes extends DashboardAttributesPageController { $type = Type::getByID($type); $this->renderAdd($type, - \URL::to('/dashboard/users/attributes', 'view', $id) + \URL::to('/dashboard/users/attributes', 'view') ); }
Don't use an undefined var in users/attributes dashboard page controller
concrete5_concrete5
train
php
7982a7d3956910406e59952e1b215d5b4dd1d8e5
diff --git a/lib/oxidized/api/rest.rb b/lib/oxidized/api/rest.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/api/rest.rb +++ b/lib/oxidized/api/rest.rb @@ -50,7 +50,7 @@ module Oxidized if $1.include? '/' group, node = $1.split("/")[1..2] else - group, node = 0, $1 + group, node = nil, $1 end ascii = if node[-4..-1] == '.txt' node = node[0..-5]
set group to nil if no group is defined
ytti_oxidized
train
rb
81f2ff96f0484308100e675ba15480ee3b3d71ba
diff --git a/lib/processImage.js b/lib/processImage.js index <HASH>..<HASH> 100644 --- a/lib/processImage.js +++ b/lib/processImage.js @@ -175,15 +175,14 @@ module.exports = options => { function startProcessing(optionalFirstChunk) { let hasEnded = false; - let cleanedUp = false; function cleanUp(doNotDestroyHijacked) { - if (!doNotDestroyHijacked) { - res.destroyHijacked(); - } - if (!cleanedUp) { + if (!doNotDestroyHijacked) { + res.destroyHijacked(); + } + cleanedUp = true; res.removeAllListeners();
Protect everything in the cleanUp() function with the flag.
papandreou_express-processimage
train
js
1e4c2c91c4227f340843ef2b391dbc31f893dbf3
diff --git a/lib/spout/version.rb b/lib/spout/version.rb index <HASH>..<HASH> 100644 --- a/lib/spout/version.rb +++ b/lib/spout/version.rb @@ -3,7 +3,7 @@ module Spout MAJOR = 0 MINOR = 8 TINY = 0 - BUILD = "beta8" # nil, "pre", "rc", "rc2" + BUILD = "beta9" # nil, "pre", "rc", "rc2" STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.') end
Version bump to <I>.beta9
nsrr_spout
train
rb
badba965fcac1de1579c61d27d95d0622fde27bc
diff --git a/zap/src/main/java/org/zaproxy/zap/view/TabbedPanel2.java b/zap/src/main/java/org/zaproxy/zap/view/TabbedPanel2.java index <HASH>..<HASH> 100644 --- a/zap/src/main/java/org/zaproxy/zap/view/TabbedPanel2.java +++ b/zap/src/main/java/org/zaproxy/zap/view/TabbedPanel2.java @@ -386,6 +386,18 @@ public class TabbedPanel2 extends TabbedPanel { addTab(title, icon, c, hideable, visible, index, true); } + @Override + public void insertTab(String title, Icon icon, Component component, String tip, int index) { + super.insertTab(title, icon, component, tip, index); + if (!isPlusTab(icon) && !this.fullTabList.contains(component)) { + this.fullTabList.add(component); + } + } + + private boolean isPlusTab(Icon icon) { + return icon == PLUS_ICON; + } + /** * Adds a tab with the given component. *
Keep track of inserted tabs Change `TabbedPanel2` to track also tabs inserted, not all of them are added (e.g. Response tab might be inserted when changing the layout of the Request/Response panels). Fix #<I>.
zaproxy_zaproxy
train
java
5486aab5aee918979733c0dcb742c635683a2670
diff --git a/test/Test/Staq/ApplicationTest.php b/test/Test/Staq/ApplicationTest.php index <HASH>..<HASH> 100755 --- a/test/Test/Staq/ApplicationTest.php +++ b/test/Test/Staq/ApplicationTest.php @@ -94,7 +94,7 @@ class ApplicationTest extends StaqTestCase public function test_error_reporting__none() { $app = \Staq\App::create(); - $this->assertEquals(0, ini_get('error_reporting')); + $this->assertEquals(0, ini_get('display_errors')); } public function test_error_reporting__display() @@ -102,7 +102,7 @@ class ApplicationTest extends StaqTestCase $this->setExpectedException('PHPUnit_Framework_Error'); $app = \Staq\App::create() ->setPlatform('local'); - $this->assertEquals(30719, ini_get('error_reporting')); + $this->assertEquals(1, ini_get('display_errors')); trigger_error('Test of warnings', E_USER_ERROR); } } \ No newline at end of file
Do not prevent error bubbling in production
Elephant418_Staq
train
php
4de50c237c3c7d77ea518b8349118a2d68d46a1f
diff --git a/h2o-core/src/main/java/water/rapids/ASTFunc.java b/h2o-core/src/main/java/water/rapids/ASTFunc.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/rapids/ASTFunc.java +++ b/h2o-core/src/main/java/water/rapids/ASTFunc.java @@ -185,6 +185,7 @@ class ASTFuncDef extends ASTOp { // parse the function args: these are just arg names -> will do _local.put(name, Env.NULL, null) (local ST put) Env.SymbolTable table = E._env.newTable(); // grab a new SymbolTable String[] args = E.skipWS().peek() == '{' ? E.xpeek('{').parseString('}').split(";") : null; + for (int i = 0; i < args.length;++i) args[i] = args[i].replaceAll("\\s+",""); _arg_names = args; if (args == null) table.put(null, Env.NULL, null); else for (String arg : args) table.put(arg, Env.NULL, null);
fix ws issue around var names
h2oai_h2o-3
train
java
707ed2b3026bc1cdaa874230ce706cd09b4f91d5
diff --git a/cmd/gateway/gcs/gateway-gcs.go b/cmd/gateway/gcs/gateway-gcs.go index <HASH>..<HASH> 100644 --- a/cmd/gateway/gcs/gateway-gcs.go +++ b/cmd/gateway/gcs/gateway-gcs.go @@ -19,6 +19,7 @@ package gcs import ( "context" "encoding/base64" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -830,12 +831,17 @@ func fromGCSAttrsToObjectInfo(attrs *storage.ObjectAttrs) minio.ObjectInfo { if attrs.ContentLanguage != "" { metadata["Content-Language"] = attrs.ContentLanguage } + + etag := hex.EncodeToString(attrs.MD5) + if etag == "" { + etag = minio.ToS3ETag(fmt.Sprintf("%d", attrs.CRC32C)) + } return minio.ObjectInfo{ Name: attrs.Name, Bucket: attrs.Bucket, ModTime: attrs.Updated, Size: attrs.Size, - ETag: minio.ToS3ETag(fmt.Sprintf("%d", attrs.CRC32C)), + ETag: etag, UserDefined: metadata, ContentType: attrs.ContentType, ContentEncoding: attrs.ContentEncoding,
gcs: use MD5Sum as ETag if present in object attrs (#<I>) Fixes: <I>
minio_minio
train
go
259a87209703953d9977dcf9c10804caac69e381
diff --git a/java/tests/com/google/template/soy/jbcsrc/TemplateAnalysisTest.java b/java/tests/com/google/template/soy/jbcsrc/TemplateAnalysisTest.java index <HASH>..<HASH> 100644 --- a/java/tests/com/google/template/soy/jbcsrc/TemplateAnalysisTest.java +++ b/java/tests/com/google/template/soy/jbcsrc/TemplateAnalysisTest.java @@ -266,25 +266,6 @@ public final class TemplateAnalysisTest { @Test public void testForeach_literalList() { // test literal lists - // empty list - runTest( - "{call .loop data=\"all\"}", - " {param list: [] /}", - "{/call}", - "{/template}", - "", - "{template .loop}", - "{@param list: list<?>}", - "{@param p: ?}", - "{@param p2: ?}", - "{for $item in $list}", - " {$p}", - "{ifempty}", - " {$p2}", - "{/for}", - "{notrefed($p)}", - "{refed($p2)}"); - // nonempty list runTest( "{@param p: ?}",
Delete incorrect test. The first template only is searched for refed/notrefed. In this case it looks like neither $p or $p2 are actually marked as refed at the end of the method. I'm not sure how to iterate over an empty list as I get a soy compilation error ("Can't iterate over empty list"). ------------- Created by MOE: <URL>
google_closure-templates
train
java
a3f23d5de3abb1ab4a0d211025e133f67cfabe07
diff --git a/container_daemon/spawn.go b/container_daemon/spawn.go index <HASH>..<HASH> 100644 --- a/container_daemon/spawn.go +++ b/container_daemon/spawn.go @@ -111,7 +111,9 @@ func wireExit(cmd *exec.Cmd, runner Runner) (*os.File, error) { func handleCompletion(runner Runner, cmd *exec.Cmd, exitW *os.File, stdout, stderr io.Writer) { defer exitW.Close() defer tryClose(stdout) - defer tryClose(stderr) + if stderr != stdout { + defer tryClose(stderr) + } status := runner.Wait(cmd) exitW.Write([]byte{status}) }
Avoid closing the same stream twice. [#<I>]
cloudfoundry-attic_garden-linux
train
go
caa847303aba0fbc95ccaf44b4660b7ce8d8bb3b
diff --git a/salt/fileclient.py b/salt/fileclient.py index <HASH>..<HASH> 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -167,6 +167,16 @@ class Client(object): ''' Download and cache all files on a master in a specified environment ''' + if env is not None: + salt.utils.warn_until( + 'Boron', + 'Passing a salt environment should be done using \'saltenv\' ' + 'not \'env\'. This functionality will be removed in Salt ' + 'Boron.' + ) + # Backwards compatibility + saltenv = env + ret = [] for path in self.file_list(saltenv): ret.append(self.cache_file('salt://{0}'.format(path), saltenv)) @@ -1103,6 +1113,16 @@ class RemoteClient(Client): ''' Return a list of the files in the file server's specified environment ''' + if env is not None: + salt.utils.warn_until( + 'Boron', + 'Passing a salt environment should be done using \'saltenv\' ' + 'not \'env\'. This functionality will be removed in Salt ' + 'Boron.' + ) + # Backwards compatibility + saltenv = env + load = {'saltenv': saltenv, 'cmd': '_file_list'} try:
add some apparently-missing env/saltenv compatibility code to fileclient
saltstack_salt
train
py
e376e4092e16ac50d9a653f854b34d026eb80dee
diff --git a/lib/Teepee.js b/lib/Teepee.js index <HASH>..<HASH> 100644 --- a/lib/Teepee.js +++ b/lib/Teepee.js @@ -369,7 +369,7 @@ Teepee.prototype.request = function (options, cb) { var requestTimeoutId; if (typeof timeout === 'number') { - currentRequest.setTimeout(options.timeout); + currentRequest.setTimeout(timeout); requestTimeoutId = setTimeout(function () { handleRequestError(new socketErrors.ETIMEDOUT()); }, timeout);
Get the timeout from the right place.
One-com_teepee
train
js
eba5df5afa75c81943d6ceb76448eb608bf570fd
diff --git a/src/WellCommerce/Bundle/MultiStoreBundle/EventListener/ShopSubscriber.php b/src/WellCommerce/Bundle/MultiStoreBundle/EventListener/ShopSubscriber.php index <HASH>..<HASH> 100644 --- a/src/WellCommerce/Bundle/MultiStoreBundle/EventListener/ShopSubscriber.php +++ b/src/WellCommerce/Bundle/MultiStoreBundle/EventListener/ShopSubscriber.php @@ -29,11 +29,22 @@ class ShopSubscriber extends AbstractEventSubscriber public static function getSubscribedEvents() { return [ - KernelEvents::CONTROLLER => ['onKernelController', -256] + KernelEvents::CONTROLLER => ['onKernelController', -256], + 'shop.post_update' => 'onShopListModified', + 'shop.post_create' => 'onShopListModified', + 'shop.post_remove' => 'onShopListModified', ]; } /** + * Clears session data after shop list was changed + */ + public function onShopListModified() + { + $this->container->get('session')->remove('admin/shops'); + } + + /** * Registers all available shops in admin session * * @param FilterControllerEvent $event
Session clear after add/update/delete of shop
WellCommerce_WishlistBundle
train
php
c1a3f3e6206e8469d71e50b5a75d39dcf4c717e0
diff --git a/src/main/java/com/couchbase/lite/replicator/Replication.java b/src/main/java/com/couchbase/lite/replicator/Replication.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/replicator/Replication.java +++ b/src/main/java/com/couchbase/lite/replicator/Replication.java @@ -104,7 +104,7 @@ public abstract class Replication { * @exclude */ @InterfaceAudience.Private - /* package */ public Replication(Database db, URL remote, boolean continuous, ScheduledExecutorService workExecutor) { + /* package */ Replication(Database db, URL remote, boolean continuous, ScheduledExecutorService workExecutor) { this(db, remote, continuous, null, workExecutor); } @@ -113,7 +113,7 @@ public abstract class Replication { * @exclude */ @InterfaceAudience.Private - /* package */ public Replication(Database db, URL remote, boolean continuous, HttpClientFactory clientFactory, ScheduledExecutorService workExecutor) { + /* package */ Replication(Database db, URL remote, boolean continuous, HttpClientFactory clientFactory, ScheduledExecutorService workExecutor) { this.db = db; this.continuous = continuous;
Noticed these constructors were not actually package private and should be.
couchbase_couchbase-lite-java-core
train
java