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
3a907a4db7e144dd4957d925993f357b109d068d
diff --git a/lib/liquid/document.rb b/lib/liquid/document.rb index <HASH>..<HASH> 100644 --- a/lib/liquid/document.rb +++ b/lib/liquid/document.rb @@ -1,8 +1,12 @@ module Liquid class Document < BlockBody + DEFAULT_OPTIONS = { + locale: I18n.new + } + def self.parse(tokens, options) doc = new - doc.parse(tokens, options) + doc.parse(tokens, DEFAULT_OPTIONS.merge(options)) doc end diff --git a/lib/liquid/template.rb b/lib/liquid/template.rb index <HASH>..<HASH> 100644 --- a/lib/liquid/template.rb +++ b/lib/liquid/template.rb @@ -13,10 +13,6 @@ module Liquid # template.render('user_name' => 'bob') # class Template - DEFAULT_OPTIONS = { - locale: I18n.new - } - attr_accessor :root attr_reader :resource_limits @@ -120,7 +116,7 @@ module Liquid @options = options @profiling = options[:profile] @line_numbers = options[:line_numbers] || @profiling - @root = Document.parse(tokenize(source), DEFAULT_OPTIONS.merge(options)) + @root = Document.parse(tokenize(source), options) @warnings = nil self end
Move DEFAULT_OPTIONS related logic to Document
Shopify_liquid
train
rb,rb
a21f3cf65482781e75a81fc28d789957ff8c13cd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -26,8 +26,6 @@ install_requires = ['Django', tests_require = ['Django', 'requests', 'tox', - 'sphinx', - 'sphinx-autobuild', 'six']
remove sphinx from reqs
marazmiki_django-ulogin
train
py
3ec705ca495d10fae57860b443f41ac72102cb14
diff --git a/src/Core/Error/ApiException.php b/src/Core/Error/ApiException.php index <HASH>..<HASH> 100644 --- a/src/Core/Error/ApiException.php +++ b/src/Core/Error/ApiException.php @@ -72,7 +72,9 @@ class ApiException extends Exception } return new ErrorResponseException($message, $request, $response, $previous); case 401: - if (strpos((string)$response->getBody(), 'invalid_token') !== false) { + $body = $response->getBody()->getContents(); + $response = $response->withBody(stream_for($body)); + if (strpos($body, 'invalid_token') !== false) { return new InvalidTokenException($message, $request, $response, $previous); } return new InvalidClientCredentialsException($message, $request, $response, $previous);
WIP: restore response body stream for invalid token error
commercetools_commercetools-php-sdk
train
php
72ea2f22d11e89c9f69ec1d3ce4aaf1dc3964cbc
diff --git a/src/main/java/hu/kazocsaba/imageviewer/DefaultStatusBar.java b/src/main/java/hu/kazocsaba/imageviewer/DefaultStatusBar.java index <HASH>..<HASH> 100644 --- a/src/main/java/hu/kazocsaba/imageviewer/DefaultStatusBar.java +++ b/src/main/java/hu/kazocsaba/imageviewer/DefaultStatusBar.java @@ -5,7 +5,7 @@ package hu.kazocsaba.imageviewer; * coordinates) and the colour of the pixel under the cursor. * @author Kazó Csaba */ -final class DefaultStatusBar extends PixelInfoStatusBar implements ImageMouseMotionListener { +public class DefaultStatusBar extends PixelInfoStatusBar implements ImageMouseMotionListener { @Override public void mouseMoved(ImageMouseEvent e) {
Make DefaultStatusBar public and non-final.
kazocsaba_imageviewer
train
java
13d5a542d46e339d18fb540690802ac4ff684cf4
diff --git a/ruby/test-integration/authorizable_keystore_spec.rb b/ruby/test-integration/authorizable_keystore_spec.rb index <HASH>..<HASH> 100644 --- a/ruby/test-integration/authorizable_keystore_spec.rb +++ b/ruby/test-integration/authorizable_keystore_spec.rb @@ -130,10 +130,10 @@ describe 'Authorizable Keystore' do intermediate_path = '/home/users/system', authorizable_id = 'authentication-service', { - :new_alias => 'somealias', + :new_alias => 'somekeystorealias', :key_store => file, :key_store_pass => 'somekeystorepassword', - :_alias => 'somealias', + :_alias => 'somecertchainalias', :key_password => 'someprivatekeypassword' } )
[ruby] Update keystore and certchain alias on keystore upload test.
shinesolutions_swagger-aem
train
rb
aa73e831c4a773d9263fba6ee57225c7e814e652
diff --git a/lib/rails_email_preview.rb b/lib/rails_email_preview.rb index <HASH>..<HASH> 100644 --- a/lib/rails_email_preview.rb +++ b/lib/rails_email_preview.rb @@ -38,12 +38,12 @@ module RailsEmailPreview class << self def layout=(layout) - [RailsEmailPreview::ApplicationController, RailsEmailPreview::EmailsController].each { |ctrl| ctrl.layout layout } - if layout && layout !~ %r(^rails_email_preview/) - # inline application routes if using an app layout - Rails.application.config.to_prepare { + Rails.application.config.to_prepare do + [RailsEmailPreview::ApplicationController, RailsEmailPreview::EmailsController].each { |ctrl| ctrl.layout layout } + if layout && layout !~ %r(^rails_email_preview/) + # inline application routes if using an app layout RailsEmailPreview.inline_main_app_routes! - } + end end end
do not lose layout on source reloads in dev
glebm_rails_email_preview
train
rb
abea203672cbcf38d91add954f3f875f474989a0
diff --git a/aagent/watchers/execwatcher/exec.go b/aagent/watchers/execwatcher/exec.go index <HASH>..<HASH> 100644 --- a/aagent/watchers/execwatcher/exec.go +++ b/aagent/watchers/execwatcher/exec.go @@ -165,6 +165,10 @@ func (w *Watcher) intervalWatcher(ctx context.Context, wg *sync.WaitGroup) { if w.properties.GatherInitialState { splay := time.Duration(rand.Intn(30)) * time.Second w.Infof("Performing initial execution after %v", splay) + if splay < 1 { + splay = 1 + } + tick.Reset(splay) }
(#<I>) guard against negative splays
choria-io_go-choria
train
go
0ad89ab699c0d8167862e9d8abbd212a1f71f715
diff --git a/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/jpa/JpaEntry.java b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/jpa/JpaEntry.java index <HASH>..<HASH> 100644 --- a/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/jpa/JpaEntry.java +++ b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/jpa/JpaEntry.java @@ -86,7 +86,7 @@ import javax.persistence.Table; @JoinColumn(name = "ENTRY_ID") private Set<JpaAction> actions = new HashSet<>(); - @OneToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL) + @OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL) @JoinColumn(name = "ENTRY_ID") private Set<JpaAddressee> addressees = new HashSet<>();
fix: correct fetch type from LAZY to EAGER
Jasig_NotificationPortlet
train
java
6cdc17dda4ada1a7c9e85ed27d60502d4b2e2a57
diff --git a/helper/communicator/config.go b/helper/communicator/config.go index <HASH>..<HASH> 100644 --- a/helper/communicator/config.go +++ b/helper/communicator/config.go @@ -86,6 +86,10 @@ func (c *Config) prepareSSH(ctx *interpolate.Context) []error { if c.SSHBastionPort == 0 { c.SSHBastionPort = 22 } + + if c.SSHBastionPrivateKey == "" && c.SSHPrivateKey != "" { + c.SSHBastionPrivateKey = c.SSHPrivateKey + } } // Validation
helper/communicator: default bastion PK to normal PK
hashicorp_packer
train
go
efa3c8943d741bab771c97f63115d65909e3b296
diff --git a/src/utils/helper.js b/src/utils/helper.js index <HASH>..<HASH> 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -58,7 +58,6 @@ function getOperation(conjunction) { } function createBoolQuery(operation, query) { - console.log('creating bool query', operation, query); let resultQuery = null; if ((Array.isArray(query) && query.length) || (!Array.isArray(query) && query)) { resultQuery = {
:mute: Remove logs
appbaseio_reactivecore
train
js
7fc11d4a4b1e6904c08a3ba47f3909f773ff00be
diff --git a/lib/nearley.js b/lib/nearley.js index <HASH>..<HASH> 100644 --- a/lib/nearley.js +++ b/lib/nearley.js @@ -38,8 +38,11 @@ State.prototype.toString = function() { State.prototype.nextState = function(data) { var state = new State(this.rule, this.dot + 1, this.reference, this.wantedBy); - state.data = this.data.slice(0); // make a cheap copy of currentState's data - state.data.push(data); // append the passed data + state.left = this; + state.right = data; + if (state.isComplete) { + state.data = state.build(); + } return state; }; @@ -59,6 +62,17 @@ State.prototype.consumeTerminal = function(inp) { return val; }; +State.prototype.build = function() { + var children = []; + var node = this; + do { + children.push(node.right); + node = node.left; + } while (node.left); + children.reverse(); + return children; +}; + State.prototype.finish = function() { if (this.rule.postprocess) { this.data = this.rule.postprocess(this.data, this.reference, Parser.fail);
Store node data as linked list! :D (sort of.) This is a really big deal. Currently slice() in `nextState` is really hurting us. Avoiding it brings exciting perf improvements (~2-3x faster).
kach_nearley
train
js
f637662b724745c752dd609f2319073aab0e0a13
diff --git a/salt/modules/swarm.py b/salt/modules/swarm.py index <HASH>..<HASH> 100644 --- a/salt/modules/swarm.py +++ b/salt/modules/swarm.py @@ -23,9 +23,7 @@ Docker Python SDK More information: https://docker-py.readthedocs.io/en/stable/ """ -# Import python libraries -# Import Salt libs import salt.utils.json diff --git a/tests/integration/modules/test_swarm.py b/tests/integration/modules/test_swarm.py index <HASH>..<HASH> 100644 --- a/tests/integration/modules/test_swarm.py +++ b/tests/integration/modules/test_swarm.py @@ -7,7 +7,6 @@ from tests.support.case import ModuleCase from tests.support.helpers import destructiveTest, slowTest from tests.support.mixins import SaltReturnAssertsMixin -# Import Salt Testing Libs from tests.support.unit import skipIf
[<I>] pre-commit
saltstack_salt
train
py,py
8f15c99e9ae086b3cc50214502e29d3211a01d2e
diff --git a/lib/wordpress_tools/cli_helper.rb b/lib/wordpress_tools/cli_helper.rb index <HASH>..<HASH> 100644 --- a/lib/wordpress_tools/cli_helper.rb +++ b/lib/wordpress_tools/cli_helper.rb @@ -31,7 +31,7 @@ module WordPressTools end def download_with_curl(url, destionation, options = {}) - sudo = options[:sudo] + sudo = options[:sudo] command = "curl '#{url}' -o '#{destionation}'" command = "sudo #{command}" if sudo == true @@ -48,7 +48,7 @@ module WordPressTools end def wp_cli_installed? - system("which wp-cli") || system("which wp") + system("which wp-cli >>#{void} 2>&1") || system("which wp >>#{void} 2>&1") end private
suppressed stdout from sysstem calls
welaika_wordpress_tools
train
rb
dcd03e9462fb9cf9419b14aafec14f035f30461c
diff --git a/src/Chat.php b/src/Chat.php index <HASH>..<HASH> 100644 --- a/src/Chat.php +++ b/src/Chat.php @@ -11,10 +11,10 @@ class Chat { $this->channel = $channel; } - public function send($message = null) + public function send($message = null, $attachments = null) { $config = $this->client->getConfig(); - $query = array_merge(array('text' => $message, 'channel' => $this->channel), $config); + $query = array_merge(array('text' => $message, 'channel' => $this->channel, 'attachments' => json_encode($attachments)), $config); $request = $this->client->request('chat.postMessage', $query)->send(); $response = new Response($request); if ($this->client->debug)
Allow sending 'attachments' as part of 'send' to allow formatted messages: <URL>
corykeane_slack-sdk
train
php
5dc92b421e1e9ff9c2e1b9ad9ef60c1b71dc3fca
diff --git a/salt/states/jboss7.py b/salt/states/jboss7.py index <HASH>..<HASH> 100644 --- a/salt/states/jboss7.py +++ b/salt/states/jboss7.py @@ -412,6 +412,7 @@ def __get_artifact(salt_source): template=None, source=salt_source['source'], source_hash=None, + source_hash_name=None, user=None, group=None, mode=None,
Added missing source_hash_name argument in get_managed function Additional fix to #<I> Customer was still seeing errors, this should now work. Tested with <I> and <I>
saltstack_salt
train
py
1cc1c847acc49b0b396864159a7298f8990ea184
diff --git a/tests/mock_server.py b/tests/mock_server.py index <HASH>..<HASH> 100644 --- a/tests/mock_server.py +++ b/tests/mock_server.py @@ -29,7 +29,7 @@ def start_service(service_name, host, port): requests.get(url, timeout=0.5, proxies=_proxy_bypass) break except requests.exceptions.ConnectionError: - time.sleep(0.5) + time.sleep(1.5) else: stop_process(process) # pytest.fail doesn't call stop_process pytest.fail("Can not start service: {}".format(service_name))
Test to see if its startup time
aio-libs_aiobotocore
train
py
cce8e6cd5a9e681543104b598de72fc01ada643b
diff --git a/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java b/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java +++ b/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java @@ -765,14 +765,15 @@ public class CmsDefaultXmlContentHandler implements I_CmsXmlContentHandler { } else { result = result.newInstance(); } - // set the configuration value for this widget - String configuration = getConfiguration(value); - if (configuration == null) { - // no individual configuration defined, try to get global default configuration - configuration = OpenCms.getXmlContentTypeManager().getWidgetDefaultConfiguration(result); + if (result != null) { + // set the configuration value for this widget + String configuration = getConfiguration(value); + if (configuration == null) { + // no individual configuration defined, try to get global default configuration + configuration = OpenCms.getXmlContentTypeManager().getWidgetDefaultConfiguration(result); + } + result.setConfiguration(configuration); } - result.setConfiguration(configuration); - return result; }
Avoiding null pointer exceptions.
alkacon_opencms-core
train
java
4199f94ce406e597c6530a5211d6c7cbc0eadffe
diff --git a/end-to-end-tests/src/test/java/fi/jumi/test/RunningTestsTest.java b/end-to-end-tests/src/test/java/fi/jumi/test/RunningTestsTest.java index <HASH>..<HASH> 100755 --- a/end-to-end-tests/src/test/java/fi/jumi/test/RunningTestsTest.java +++ b/end-to-end-tests/src/test/java/fi/jumi/test/RunningTestsTest.java @@ -30,9 +30,8 @@ public class RunningTestsTest { printProcessOutput(launcher); launcher.setJumiHome(sandboxDir); - // TODO: is adding to classpath really required, or will it happend automatically? String threadSafetyAgent = TestEnvironment.getProjectJar("thread-safety-agent").getAbsolutePath(); - launcher.setJvmOptions("-javaagent:" + threadSafetyAgent, "-cp", threadSafetyAgent); + launcher.setJvmOptions("-javaagent:" + threadSafetyAgent); } @Before
It's not necessary to add Java agents to classpath
luontola_jumi-actors
train
java
c0d891cc0b5a58ed91d558109b189c70f17a800c
diff --git a/forms/gridfield/GridField.php b/forms/gridfield/GridField.php index <HASH>..<HASH> 100755 --- a/forms/gridfield/GridField.php +++ b/forms/gridfield/GridField.php @@ -123,7 +123,10 @@ class GridField extends FormField { */ public function getModelClass() { if ($this->modelClassName) return $this->modelClassName; - if ($this->list && $this->list->dataClass) return $this->list->dataClass; + if ($this->list && method_exists($this->list, 'dataClass')) { + $class = $this->list->dataClass(); + if($class) return $class; + } throw new LogicException('GridField doesn\'t have a modelClassName, so it doesn\'t know the columns of this grid.'); }
BUGFIX: Fixed GridField::getModelClass() not to access protected property.
silverstripe_silverstripe-framework
train
php
1b6c381e9e2b73aa02abd9d62eda0e61459633b4
diff --git a/py/selenium/webdriver/common/keys.py b/py/selenium/webdriver/common/keys.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/common/keys.py +++ b/py/selenium/webdriver/common/keys.py @@ -92,4 +92,4 @@ class Keys(object): META = u'\ue03d' COMMAND = u'\ue03d' - ZENKAKU_HANKAKU: '\uE040' + ZENKAKU_HANKAKU = u'\ue040'
[py] that is definitely the wrong syntax for python
SeleniumHQ_selenium
train
py
9348e1c87df07280567af920ce47c24492f5aeaa
diff --git a/tests/test_helpers.py b/tests/test_helpers.py index <HASH>..<HASH> 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -397,7 +397,8 @@ class ScriptDownloaderTestCase(unittest.TestCase): # checks mock_downloader_class.assert_called_with(test_url) - self.assertLoggedInfo("Downloading remote script", test_url, filepath, 'mock downloader') + self.assertLoggedInfo( + "Downloading remote script", test_url, repr(filepath), 'mock downloader') with open(filepath, "rt", encoding='utf8') as fh: self.assertEqual(fh.read(), test_content)
Check for repr of the path.
PyAr_fades
train
py
7ac090da21141837776aefb99fd8504e5c9c5648
diff --git a/vendor/ember-suave/test-loader.js b/vendor/ember-suave/test-loader.js index <HASH>..<HASH> 100644 --- a/vendor/ember-suave/test-loader.js +++ b/vendor/ember-suave/test-loader.js @@ -1,7 +1,12 @@ -/* globals jQuery, QUnit */ +/* globals requirejs, jQuery, QUnit */ jQuery(document).ready(function () { - var TestLoaderModule = require('ember-cli/test-loader'); + var testLoaderModulePath = 'ember-cli-test-loader/test-support/index'; + if (!requirejs.entries[testLoaderModulePath]) { + testLoaderModulePath = 'ember-cli/test-loader'; + } + + var TestLoaderModule = require(testLoaderModulePath); var addModuleExcludeMatcher = TestLoaderModule['addModuleExcludeMatcher']; function isJscsDisabled() { return typeof QUnit === 'undefined' ? false : QUnit.urlParams.nojscs; }
Make compatible with ember-cli-qunit@<I>. In ember-cli-qunit@<I> `ember-cli-test-loader` is attempted to be loaded as an addon and falling back to the bower version if the addon is not present. This change brings ember-suave in line with those changes.
DavyJonesLocker_ember-suave
train
js
04c07184013d5e5f476e3935d4d4619f8a04dcb5
diff --git a/routing/result_interpretation.go b/routing/result_interpretation.go index <HASH>..<HASH> 100644 --- a/routing/result_interpretation.go +++ b/routing/result_interpretation.go @@ -348,6 +348,10 @@ func (i *interpretedResult) processPaymentOutcomeIntermediate( reportOutgoing() + // All nodes up to the failing pair must have forwarded + // successfully. + i.successPairRange(route, 0, errorSourceIdx-1) + // If we get a permanent channel, we'll prune the channel set in both // directions and continue with the rest of the routes. case *lnwire.FailPermanentChannelFailure: diff --git a/routing/result_interpretation_test.go b/routing/result_interpretation_test.go index <HASH>..<HASH> 100644 --- a/routing/result_interpretation_test.go +++ b/routing/result_interpretation_test.go @@ -362,6 +362,7 @@ var resultTestCases = []resultTestCase{ pairResults: map[DirectedNodePair]pairResult{ getTestPair(1, 2): failPairResult(0), getTestPair(2, 1): failPairResult(0), + getTestPair(0, 1): successPairResult(100), }, policyFailure: getPolicyFailure(1, 2), },
routing: report success up to the failing node on FailChannelDisabled
lightningnetwork_lnd
train
go,go
2674ba99a25cc6b2df2986f22a46c0cb627b04f3
diff --git a/swift_sync.py b/swift_sync.py index <HASH>..<HASH> 100755 --- a/swift_sync.py +++ b/swift_sync.py @@ -24,7 +24,7 @@ def get_account(): def get_files(args): swift_url = os.environ['OS_SWIFT_URL'] account = get_account() - container_url = '{0}/v1/{1}/{2}?format=json'.format( + container_url = '{0}/{1}/{2}?format=json'.format( swift_url, account, args.container) print("Checking {0}".format(container_url)) response = urllib2.urlopen(container_url)
v1 is in the swift_url.
juju_juju
train
py
62a17dbbd2e178bd99c9346bc233a94dc0255ff2
diff --git a/Flickr4Java/src/com/flickr4java/flickr/REST.java b/Flickr4Java/src/com/flickr4java/flickr/REST.java index <HASH>..<HASH> 100644 --- a/Flickr4Java/src/com/flickr4java/flickr/REST.java +++ b/Flickr4Java/src/com/flickr4java/flickr/REST.java @@ -279,6 +279,9 @@ public class REST extends Transport { if (Flickr.debugStream) { System.out.println(strXml); } + if(strXml.startsWith("oauth_problem=")) { + throw new FlickrRuntimeException(strXml); + } Document document = builder.parse(new InputSource(new StringReader(strXml))); response = (com.flickr4java.flickr.Response) responseClass.newInstance(); response.parse(document);
If there's an OAuth issue, Flickr returns a string, and not an XML. In the post added a detection for this, to throw an error, rather than letting it go on. if it goes on then WC3 will throw an error
boncey_Flickr4Java
train
java
24b62a10024f80c83be877e20421d0593b900ba9
diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index <HASH>..<HASH> 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -422,6 +422,15 @@ fi export COMPOSER_BIN_DIR=\$(cd "\${self%[/\\\\]*}" > /dev/null; pwd) +# If bash is sourcing this file, we have to source the target as well +bashSource="\$BASH_SOURCE" +if [ -n "\$bashSource" ]; then + if [ "\$bashSource" != "\$0" ]; then + source "\${dir}/$binFile" "\$@" + return + fi +fi + "\${dir}/$binFile" "\$@" PROXY;
Add support for sourcing binaries despite the bin proxy being present, take 2
composer_composer
train
php
1d0417902a311b5867807cd7123f7e71aca3df52
diff --git a/views/site/standard_template.php b/views/site/standard_template.php index <HASH>..<HASH> 100755 --- a/views/site/standard_template.php +++ b/views/site/standard_template.php @@ -28,7 +28,7 @@ <meta name="description" content="<?= htmlspecialchars( $page->description );?>" /> <meta name="keywords" content="<?= htmlspecialchars( $page->keywords );?>" /> <script type='text/javascript' src='/sledge/js/jquery.js'></script> - <script type="text/javascript" src="/js/main_init.js"></script> + <script type="text/javascript" src="/site/js/main_init.js"></script> <?= View::factory( 'site/css' ); ?>
Updated link to site js
boomcms_boom-core
train
php
668169304fab4310be2684ac2030bec2ba4c3692
diff --git a/lxd/daemon_config.go b/lxd/daemon_config.go index <HASH>..<HASH> 100644 --- a/lxd/daemon_config.go +++ b/lxd/daemon_config.go @@ -55,7 +55,7 @@ func (k *daemonConfigKey) Validate(d *Daemon, value string) error { } // Validate booleans - if k.valueType == "bool" && !shared.StringInSlice(strings.ToLower(value), []string{"true", "false", "1", "0", "yes", "no"}) { + if k.valueType == "bool" && !shared.StringInSlice(strings.ToLower(value), []string{"true", "false", "1", "0", "yes", "no", "on", "off"}) { return fmt.Errorf("Invalid value for a boolean: %s", value) } @@ -145,7 +145,7 @@ func (k *daemonConfigKey) GetBool() bool { } // Convert to boolean - if shared.StringInSlice(strings.ToLower(value), []string{"true", "1", "yes"}) { + if shared.StringInSlice(strings.ToLower(value), []string{"true", "1", "yes", "on"}) { return true }
Allow on/off as boolean strings
lxc_lxd
train
go
d02883cf1f6ad4919220aa1dd164932ea2d0a978
diff --git a/lib/sass/script/funcall.rb b/lib/sass/script/funcall.rb index <HASH>..<HASH> 100644 --- a/lib/sass/script/funcall.rb +++ b/lib/sass/script/funcall.rb @@ -145,10 +145,10 @@ module Sass def perform_sass_fn(function, args, keywords) # TODO: merge with mixin arg evaluation? - keywords.each do |name, value| - # TODO: Make this fast - unless function.args.find {|(var, default)| var.underscored_name == name} - raise Sass::SyntaxError.new("Function #{@name} doesn't have an argument named $#{name}") + if keywords.any? + unknown_args = keywords.keys - function.args.map {|var| var.first.underscored_name } + if unknown_args.any? + raise Sass::SyntaxError.new("Function #{@name} doesn't have an arguments: #{unknwon_args.map{|name| "$#{name}"}}") end end
A bit faster (for most cases) check for unknwon named argments in function call
sass_ruby-sass
train
rb
dfc63670663d1b15de5d5acbf3254f14a0bb71e7
diff --git a/lib/sanford/version.rb b/lib/sanford/version.rb index <HASH>..<HASH> 100644 --- a/lib/sanford/version.rb +++ b/lib/sanford/version.rb @@ -1,3 +1,3 @@ module Sanford - VERSION = "0.12.0" + VERSION = "0.13.0" end
version to <I> * require the latest dat-tcp f<I>a<I>bc4d3c<I>b3a<I>c1c2e<I> * add `router` and `template_source` instance methods to the server obj #<I> * rework template source api for querying about configured engines #<I> /cc @jcredding
redding_sanford
train
rb
cb1e9d0131ffbf0899a49f109ef6eabc9a8ba321
diff --git a/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java b/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java index <HASH>..<HASH> 100644 --- a/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java +++ b/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java @@ -604,7 +604,7 @@ public class GVRPicker extends GVRBehavior { GVRCollider collider = GVRCollider.lookup(colliderPointer); if (collider == null) { - Log.d("Picker", "makeHit: cannot find collider for %p", colliderPointer); + Log.d(TAG, "makeHit: cannot find collider for %x", colliderPointer); return null; } return new GVRPicker.GVRPickedObject(collider, new float[] { hitx, hity, hitz }, distance);
Fix for a UnknownFormatConversionException that leads to a crash
Samsung_GearVRf
train
java
b28f1a017e7500b6e63f40c163e7c64ffb68ab10
diff --git a/src/Bar.js b/src/Bar.js index <HASH>..<HASH> 100644 --- a/src/Bar.js +++ b/src/Bar.js @@ -54,6 +54,8 @@ export default class BarChart extends Component { } }, axisY: { + min: false, + max: false, showAxis: true, showLines: true, showLabels: true, @@ -78,8 +80,9 @@ export default class BarChart extends Component { } getMaxAndMin(values, scale) { - let maxValue = 0 - let minValue = 0 + const axisY = this.props.options.axisY + let maxValue = axisY.max || 0 + let minValue = axisY.min || 0 let max = _.max(values) if (max > maxValue) maxValue = max @@ -106,7 +109,9 @@ export default class BarChart extends Component { gutter: this.props.options.gutter || 10, width: options.chartWidth, height: options.chartHeight, - accessor: accessor + accessor: accessor, + min: this.props.options.axisY.min || undefined, + max: this.props.options.axisY.max || undefined, }) let values = chart.curves.map((curve) => accessor(curve.item))
Add min/max scale support to the y axis on the bar chart (#<I>)
capitalone_react-native-pathjs-charts
train
js
06c4347775f93f5ea99d9a6c3393f100cf2158a8
diff --git a/api/urls.py b/api/urls.py index <HASH>..<HASH> 100644 --- a/api/urls.py +++ b/api/urls.py @@ -202,9 +202,13 @@ Auth Create a new :class:`~api.models.UserRegistration`. -.. http:post:: /api/auth/??? +.. http:post:: /api/auth/login - TODO: document the important rest_framework login URLs + Authenticate for the REST framework. + +.. http:post:: /api/auth/logout + + Clear authentication for the REST framework. .. http:get:: /api/generate-api-key/
Fixed #<I> -- doc the 2 restframework methods.
deis_deis
train
py
c649d778802b7eae08a7d2676b907d06ac65663b
diff --git a/sorl/thumbnail/engines/pil_engine.py b/sorl/thumbnail/engines/pil_engine.py index <HASH>..<HASH> 100644 --- a/sorl/thumbnail/engines/pil_engine.py +++ b/sorl/thumbnail/engines/pil_engine.py @@ -1,4 +1,3 @@ -from io import BytesIO from sorl.thumbnail.engines.base import EngineBase from sorl.thumbnail.compat import BufferIO @@ -41,14 +40,14 @@ class GaussianBlur(ImageFilter.Filter): class Engine(EngineBase): def get_image(self, source): - buffer = BytesIO(source.read()) + buffer = BufferIO(source.read()) return Image.open(buffer) def get_image_size(self, image): return image.size def is_valid_image(self, raw_data): - buffer = BytesIO(raw_data) + buffer = BufferIO(raw_data) try: trial_image = Image.open(buffer) trial_image.verify()
Always use compat.BufferIO in pil_engine.
jazzband_sorl-thumbnail
train
py
f3c663c2d8a793dc60a893a57d8a55f620141ad8
diff --git a/src/ElephantOnCouch/Message/Request.php b/src/ElephantOnCouch/Message/Request.php index <HASH>..<HASH> 100755 --- a/src/ElephantOnCouch/Message/Request.php +++ b/src/ElephantOnCouch/Message/Request.php @@ -295,7 +295,7 @@ final class Request extends Message { //! @param[in] string $value Parameter value. public function setQueryParam($name, $value) { if (preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) - $this->queryParams[$name] = rawurlencode($value); + $this->queryParams[$name] = $value; else throw new \InvalidArgumentException("\$name must start with a letter or underscore, followed by any number of letters, numbers, or underscores.");
fixed a bug on setQueryParam(), I was encoding two times
dedalozzo_eoc-client
train
php
382048e31e872d23188fab6bec68323f593ccc19
diff --git a/SpiffWorkflow/bpmn/DMNPythonScriptEngine.py b/SpiffWorkflow/bpmn/DMNPythonScriptEngine.py index <HASH>..<HASH> 100644 --- a/SpiffWorkflow/bpmn/DMNPythonScriptEngine.py +++ b/SpiffWorkflow/bpmn/DMNPythonScriptEngine.py @@ -33,7 +33,7 @@ class DMNPythonScriptEngine(PythonScriptEngine): will play nice with the existing FeelLikeScriptEngine """ def __init__(self): - pass + super().__init__() def eval_dmn_expression(self, inputExpr, matchExpr, **kwargs): """ diff --git a/SpiffWorkflow/bpmn/FeelLikeScriptEngine.py b/SpiffWorkflow/bpmn/FeelLikeScriptEngine.py index <HASH>..<HASH> 100644 --- a/SpiffWorkflow/bpmn/FeelLikeScriptEngine.py +++ b/SpiffWorkflow/bpmn/FeelLikeScriptEngine.py @@ -278,7 +278,7 @@ class FeelLikeScriptEngine(PythonScriptEngine): expressions in a mini-language of your own. """ def __init__(self): - pass + super().__init__() def patch_expression(self,invalid_python,lhs=''): if invalid_python is None:
Fixing a slight bug in the script engines.
knipknap_SpiffWorkflow
train
py,py
141c6306becbbb876600d2dacb41537dbb41ca11
diff --git a/lib/tophat/opengraph.rb b/lib/tophat/opengraph.rb index <HASH>..<HASH> 100644 --- a/lib/tophat/opengraph.rb +++ b/lib/tophat/opengraph.rb @@ -59,7 +59,8 @@ module TopHat end end - def fb_like() + def fb_like(options={}) + tag("fb:like", options) end end diff --git a/test/test_opengraph.rb b/test/test_opengraph.rb index <HASH>..<HASH> 100644 --- a/test/test_opengraph.rb +++ b/test/test_opengraph.rb @@ -65,6 +65,12 @@ class TopHatOpenGraphTestCase < Test::Unit::TestCase end + context "generating a like button" do + should "render the tag" do + assert_equal @template.fb_like(:href => 'http://developers.facebook.com/', :width => '450', :height => 80), '<fb:like height="80" href="http://developers.facebook.com/" width="450" />' + end + end + end end \ No newline at end of file
added a fb_like method
stve_tophat
train
rb,rb
4957c8cd10bf14f9ac28a9813944446b8f69609e
diff --git a/src/main/java/org/efaps/ui/wicket/models/objects/grid/UIGrid.java b/src/main/java/org/efaps/ui/wicket/models/objects/grid/UIGrid.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/efaps/ui/wicket/models/objects/grid/UIGrid.java +++ b/src/main/java/org/efaps/ui/wicket/models/objects/grid/UIGrid.java @@ -231,7 +231,7 @@ public class UIGrid multi.addMsgPhrase(field.getProperty(UITableFieldProperty.SORT_MSG_PHRASE)); } } - multi.execute(); + multi.executeWithoutAccessCheck(); while (multi.next()) { final GridRow row = new GridRow(multi.getCurrentInstance()); this.values.add(row);
Grid move to be able to do a Tree
eFaps_eFaps-WebApp
train
java
97c0bd4f0db9a439acd3c469cf2c8099d37a48fb
diff --git a/chalice/app.py b/chalice/app.py index <HASH>..<HASH> 100644 --- a/chalice/app.py +++ b/chalice/app.py @@ -72,8 +72,8 @@ def _matches_content_type(content_type, valid_content_types): elif ';' in content_type: for section in content_type.split(';'): - for type in section.split(','): - if type.lower().strip() in valid_content_types: + for mime_type in section.split(','): + if mime_type.lower().strip() in valid_content_types: content_type_matches = True elif content_type in valid_content_types: content_type_matches = True
Change variable to not clash with bultin keyword
aws_chalice
train
py
b80cf2ea6066ba66e67e5c2377c5a81fce3272b7
diff --git a/src/main/java/io/reactivesocket/internal/Responder.java b/src/main/java/io/reactivesocket/internal/Responder.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/reactivesocket/internal/Responder.java +++ b/src/main/java/io/reactivesocket/internal/Responder.java @@ -26,6 +26,7 @@ import io.reactivesocket.RequestHandler; import io.reactivesocket.exceptions.InvalidSetupException; import io.reactivesocket.exceptions.RejectedException; import io.reactivesocket.exceptions.SetupException; +import io.reactivesocket.internal.frame.FrameHeaderFlyweight; import io.reactivesocket.internal.frame.SetupFrameFlyweight; import io.reactivesocket.internal.rx.EmptyDisposable; import io.reactivesocket.internal.rx.EmptySubscription; @@ -431,7 +432,7 @@ public class Responder { onError(exc); } else { Frame nextCompleteFrame = Frame.Response.from( - streamId, FrameType.NEXT_COMPLETE, v); + streamId, FrameType.RESPONSE, v.getMetadata(), v.getData(), FrameHeaderFlyweight.FLAGS_RESPONSE_C); child.onNext(nextCompleteFrame); } }
request response now returns a response frame with a complete flag set
rsocket_rsocket-java
train
java
42feb43f4283b66c25817e68ee917ef0d02aff18
diff --git a/src/views/boom/editor/toolbar.php b/src/views/boom/editor/toolbar.php index <HASH>..<HASH> 100755 --- a/src/views/boom/editor/toolbar.php +++ b/src/views/boom/editor/toolbar.php @@ -46,10 +46,6 @@ <?php endif ?> <div class="b-page-container"> - <?/*<button id="boom-page-editlive" class="ui-button boom-button" data-icon="ui-icon-boom-edit-live"> - <?=Lang::get('Edit live') ?> - </button>*/?> - <?= new \BoomCMS\Core\UI\Button('view-live', Lang::get('View the page as it appears on the live site'), ['id' => 'boom-page-viewlive', 'class' => 'b-button-preview', 'data-preview' => 'disabled']) ?> </div>
Removed commented code from editor toolbar
boomcms_boom-core
train
php
a62920f2cade2670ee6dcde2d2caf0b4f0bb0c46
diff --git a/closure/goog/debug/debugwindow.js b/closure/goog/debug/debugwindow.js index <HASH>..<HASH> 100644 --- a/closure/goog/debug/debugwindow.js +++ b/closure/goog/debug/debugwindow.js @@ -603,3 +603,16 @@ goog.debug.DebugWindow.prototype.addFilter = function(loggerName) { goog.debug.DebugWindow.prototype.removeFilter = function(loggerName) { delete this.filteredLoggers_[loggerName]; }; + + +/** + * Modify the size of the circular buffer. Allows the log to retain more + * information while the window is closed. + * @param {number} size New size of the circular buffer. + */ +goog.debug.DebugWindow.prototype.resetBufferWithNewSize = function(size) { + if (size > 0 && size < 50000) { + this.clear_(); + this.savedMessages_ = new goog.structs.CircularBuffer(size); + } +};
Allow changes to the circular buffer size. R=gboyer,arv,pupius,nicksantos DELTA=<I> (<I> added, 0 deleted, 0 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-library
train
js
1c1c5371b7c91353ba7e2f8a299f8fe6905300d5
diff --git a/lib/dimples/site.rb b/lib/dimples/site.rb index <HASH>..<HASH> 100644 --- a/lib/dimples/site.rb +++ b/lib/dimples/site.rb @@ -36,7 +36,6 @@ module Dimples end def generate - prepare_output_directory scan_files generate_files copy_assets @@ -160,6 +159,8 @@ module Dimples end def generate_files + prepare_output_directory + generate_pages unless @pages.count.zero? return if @posts.count.zero?
Update generate_files to call prepare_output_directory.
waferbaby_dimples
train
rb
1bb6a4bfa98630e5ea2377a8e763c36351e1134d
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java +++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java @@ -650,7 +650,7 @@ public abstract class NanoHTTPD { protected int sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header, int size) { for (String headerName : header.keySet()) { - if (headerName.equalsIgnoreCase("content-length") { + if (headerName.equalsIgnoreCase("content-length")) { try { return Integer.parseInt(header.get(headerName)); } catch (NumberFormatException ex) {
Fixed missing paren, Issue #<I>
NanoHttpd_nanohttpd
train
java
690ca5e6b05cbce763aebb17546cbb36fdb313bd
diff --git a/public/js/components/EditorSearchBar.js b/public/js/components/EditorSearchBar.js index <HASH>..<HASH> 100644 --- a/public/js/components/EditorSearchBar.js +++ b/public/js/components/EditorSearchBar.js @@ -4,12 +4,12 @@ const { findDOMNode } = require("react-dom"); const Svg = require("./utils/Svg"); const { find, findNext, findPrev } = require("../utils/source-search"); const classnames = require("classnames"); -const debounce = require("lodash").debounce; +const { debounce, escapeRegExp } = require("lodash"); require("./EditorSearchBar.css"); function countMatches(query, text) { - const re = new RegExp(query, "g"); + const re = new RegExp(escapeRegExp(query), "g"); const match = text.match(re); return match ? match.length : 0; }
Escape EditorSearchBar queries before using as RegExp (#<I>)
firefox-devtools_debugger
train
js
cbcfc43072d3da409068a11fe261c7abea6a211d
diff --git a/lib/Epuber/server/keyboard_control.js b/lib/Epuber/server/keyboard_control.js index <HASH>..<HASH> 100644 --- a/lib/Epuber/server/keyboard_control.js +++ b/lib/Epuber/server/keyboard_control.js @@ -2,6 +2,13 @@ window.addEventListener('keydown', function (e) { var l = window.location; + // alt == 18 + // cmd == 91 + if (e.which == 91) // cmd + { + return; + } + switch (e.keyCode) { case 37: // left @@ -23,4 +30,4 @@ window.addEventListener('keydown', function (e) { break; } -}); +}, false);
[Server][keyboard_control.js] do not jump when command key is down
epuber-io_epuber
train
js
8ae7fe1ec52ab80eaf5a218dbef2ca3228a52bf5
diff --git a/tests/React/Curry/UtilTest.php b/tests/React/Curry/UtilTest.php index <HASH>..<HASH> 100644 --- a/tests/React/Curry/UtilTest.php +++ b/tests/React/Curry/UtilTest.php @@ -27,7 +27,7 @@ class UtilTest extends \PHPUnit_Framework_TestCase $this->assertSame(6, $addOneAndFive()); } - public function createAddFunction() + private function createAddFunction() { return function ($a, $b) { return $a + $b;
Update tests/React/Curry/UtilTest.php
friends-of-reactphp_partial
train
php
af1acf754eade8b20e8c4ebf1f3518377345f5fe
diff --git a/src/Table.php b/src/Table.php index <HASH>..<HASH> 100644 --- a/src/Table.php +++ b/src/Table.php @@ -145,7 +145,7 @@ class Table extends BaseTable public function getReminderFields() { $result = []; - foreach ($this->getFieldsDefinitions($this->alias()) as $field) { + foreach ($this->getFieldsDefinitions(Inflector::camelize($this->table())) as $field) { if ($field['type'] == 'reminder') { $result[] = $field; }
Fixed incorrect reference to association instead of table
QoboLtd_cakephp-csv-migrations
train
php
ce6e82cd56f81406190ff0e90f4c3389bc57b19c
diff --git a/lib/logger.js b/lib/logger.js index <HASH>..<HASH> 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,4 +1,5 @@ var winston = require('winston'); +var config = require('./config-loader'); var logger = new winston.Logger({ transports: [ @@ -15,5 +16,13 @@ var loggerStream = {write: function (data) { logger.info(data.replace(/\n$/, '')); }}; +var logInfo = logger.info; + +logger.info = function() { + if (config.get('NODE_ENV') !== 'test') { + logInfo.apply(logger, arguments); + } +}; + exports.logger = logger; exports.loggerStream = loggerStream;
Suppress database logging during tests
ripple_ripple-rest
train
js
ca2829aae2072be64d2e84dcb5c8acb2979d15fa
diff --git a/amazon_dash/scan.py b/amazon_dash/scan.py index <HASH>..<HASH> 100644 --- a/amazon_dash/scan.py +++ b/amazon_dash/scan.py @@ -21,6 +21,9 @@ def scan_devices(fn, lfilter, iface=None): :return: loop """ try: - sniff(prn=fn, store=0, filter="udp", lfilter=lfilter, iface=iface) + sniff(prn=fn, store=0, + # filter="udp", + filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", + lfilter=lfilter, iface=iface) except PermissionError: raise SocketPermissionError
Issue #<I>: Evaluate to change sniff filters
Nekmo_amazon-dash
train
py
32a890d6d451ed768f8564beda887fa883e1ae74
diff --git a/lib/dimples/site.rb b/lib/dimples/site.rb index <HASH>..<HASH> 100644 --- a/lib/dimples/site.rb +++ b/lib/dimples/site.rb @@ -83,7 +83,6 @@ module Dimples end def scan_posts - Dir.glob(File.join(@source_paths[:posts], '*.*')).reverse.each do |path| post = @post_class.new(self, path) @@ -102,6 +101,11 @@ module Dimples @posts << post end + @posts.each_index do |index| + posts[index].next_post = @posts.fetch(index - 1, nil) if index - 1 > 0 + @posts[index].previous_post = @posts.fetch(index + 1, nil) if index + 1 < @posts.count + end + @latest_post = @posts.first end @@ -190,7 +194,7 @@ module Dimples path += File.split(paths[0])[-1] + "/" if paths[0] != @output_paths[:site] path += paths[1..-1].join('/') + "/" if paths.length > 1 - + path end
Updated the scan_posts method to set a post's neighbours.
waferbaby_dimples
train
rb
45c1a2c5c161292a12c220fc9af103a70a1613fb
diff --git a/tests/HTMLPurifier/HTMLModule/HTML5/TextTest.php b/tests/HTMLPurifier/HTMLModule/HTML5/TextTest.php index <HASH>..<HASH> 100644 --- a/tests/HTMLPurifier/HTMLModule/HTML5/TextTest.php +++ b/tests/HTMLPurifier/HTMLModule/HTML5/TextTest.php @@ -384,6 +384,10 @@ class HTMLPurifier_HTMLModule_HTML5_TextTest extends BaseTestCase 'empty figure' => array( '<figure></figure>', ), + 'deep figcaption' => array( + '<figure><div><div><figcaption>Foo</figcaption></div></div></figure>', + '<figure><div><div></div></div><figcaption>Foo</figcaption></figure>', + ), ); }
Add test for deep figcaption
xemlock_htmlpurifier-html5
train
php
ef0454432852de8b865990d930f54bc9fa72e3d6
diff --git a/lib/chai/interface/should.js b/lib/chai/interface/should.js index <HASH>..<HASH> 100644 --- a/lib/chai/interface/should.js +++ b/lib/chai/interface/should.js @@ -10,10 +10,8 @@ module.exports = function (chai, util) { function loadShould () { // explicitly define this method as function as to have it's name to include as `ssfi` function shouldGetter() { - if (this instanceof String || this instanceof Number) { - return new Assertion(this.constructor(this), null, shouldGetter); - } else if (this instanceof Boolean) { - return new Assertion(this == true, null, shouldGetter); + if (this instanceof String || this instanceof Number || this instanceof Boolean ) { + return new Assertion(this.valueOf(), null, shouldGetter); } return new Assertion(this, null, shouldGetter); }
Primitives now use valueOf in shouldGetter This allows the should syntax to be more resilient when dealing with modified primitive constructors which may occur more frequently with ES6 to ES5 transpilation.
chaijs_chai
train
js
c8bf1f16103b10d9ae48f4644f192bcde9d10a2b
diff --git a/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java b/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java index <HASH>..<HASH> 100644 --- a/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java +++ b/src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java @@ -3524,10 +3524,9 @@ public class CDKAtomTypeMatcherTest extends AbstractCDKAtomTypeTest { IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance(); IMolecule mol = builder.newInstance(IMolecule.class); IAtom a1 = builder.newInstance(IAtom.class,"Te"); - a1.setFormalCharge(0); + a1.setFormalCharge(4); mol.addAtom(a1); - String[] expectedTypes = {"Te.4plus"}; assertAtomTypes(testedAtomTypes, expectedTypes, mol); }
Fixed charge in unit test: <I> not 0
cdk_cdk
train
java
904beb3548efa8eea5edf88f1bd7ff4504b45beb
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -263,8 +263,8 @@ if on_saltstack: copyright = time.strftime("%Y") # < --- START do not merge these settings to other branches START ---> # -build_type = 'latest' # latest, previous, develop, next -release = latest_release # version, latest_release, previous_release +build_type = 'previous' # latest, previous, develop, next +release = previous_release # version, latest_release, previous_release # < --- END do not merge these settings to other branches END ---> # # Set google custom search engine
[<I>] change build_type and release in doc/conf.py
saltstack_salt
train
py
8a4eb8eea77fe4994681b6fa503e273be01e417f
diff --git a/Gemfile.lock b/Gemfile.lock index <HASH>..<HASH> 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - warden (1.1.1) + warden (1.2.0) rack (>= 1.0) GEM 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 @@ -14,6 +14,7 @@ end RSpec.configure do |config| config.include(Warden::Spec::Helpers) + config.include(Warden::Test::Helpers) def load_strategies Dir[File.join(File.dirname(__FILE__), "helpers", "strategies", "**/*.rb")].each do |f| diff --git a/spec/warden/test/helpers_spec.rb b/spec/warden/test/helpers_spec.rb index <HASH>..<HASH> 100644 --- a/spec/warden/test/helpers_spec.rb +++ b/spec/warden/test/helpers_spec.rb @@ -2,8 +2,6 @@ require 'spec_helper' describe Warden::Test::Helpers do - include Warden::Test::Helpers - before{ $captures = [] } after{ Warden.test_reset! }
make hidden global include obvious, now all tests pass when run on their own (previously proxy_spec failed when run on its own)
wardencommunity_warden
train
lock,rb,rb
f53f2bff45e0bd3a529305098b97fd665c39925c
diff --git a/lib/respect/unit_test_helper.rb b/lib/respect/unit_test_helper.rb index <HASH>..<HASH> 100644 --- a/lib/respect/unit_test_helper.rb +++ b/lib/respect/unit_test_helper.rb @@ -7,7 +7,7 @@ module Respect if msg message = msg else - message = "Schema:\n#{schema}expected to validate object <#{object}> but failed with '#{schema.last_error.context.join(" ")}'." + message = "Schema:\n#{schema}expected to validate object <#{object}> but failed with \"#{schema.last_error.context.join(" ")}\"." end assert false, message end
Double-quote are more readable here.
nicolasdespres_respect
train
rb
566c90e8d838a58085b324e12b4f22b126abe752
diff --git a/lib/specjour/db_scrub.rb b/lib/specjour/db_scrub.rb index <HASH>..<HASH> 100644 --- a/lib/specjour/db_scrub.rb +++ b/lib/specjour/db_scrub.rb @@ -25,12 +25,8 @@ module Specjour def scrub connect_to_database - if pending_migrations? - puts "Migrating schema for database #{ENV['TEST_ENV_NUMBER']}..." - schema_load_task.invoke - else - purge_tables - end + puts "Resetting database #{ENV['TEST_ENV_NUMBER']}…" + schema_load_task.invoke end protected @@ -48,14 +44,6 @@ module Specjour ActiveRecord::Base.connection end - def purge_tables - connection.disable_referential_integrity do - tables_to_purge.each do |table| - connection.delete "delete from #{table}" - end - end - end - def pending_migrations? ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations.any? end
DbScrub always recreates the database Sometimes, pending migrations isn't a good enough indicator to know if the database has changed
sandro_specjour
train
rb
b71d90b757bc2b0d337137e421c5bde9f096e955
diff --git a/benchexec/tablegenerator/__init__.py b/benchexec/tablegenerator/__init__.py index <HASH>..<HASH> 100644 --- a/benchexec/tablegenerator/__init__.py +++ b/benchexec/tablegenerator/__init__.py @@ -762,8 +762,7 @@ def merge_task_lists(runset_results, tasks): for task in tasks: run_result = dic.get(task) if run_result is None: - assert len(task) == 1\ - and len(runset.attributes['tool']) == 1\ + assert len(runset.attributes['tool']) == 1\ and len(runset.attributes['name']) == 1\ and len(runset.attributes['benchmarkname']) == 1 logging.info(" no result for task '%s' (tool='%s', benchmark='%s', benchmark name='%s').",
Fix wrong assertion in table generator: Task is a tuple of three.
sosy-lab_benchexec
train
py
f65b48d4f5aa00093858ad1b908dc65da4508d36
diff --git a/copulas/bivariate/gumbel.py b/copulas/bivariate/gumbel.py index <HASH>..<HASH> 100644 --- a/copulas/bivariate/gumbel.py +++ b/copulas/bivariate/gumbel.py @@ -139,4 +139,7 @@ class Gumbel(Bivariate): On Gumbel copula :math:`\tau` is defined as :math:`τ = \frac{θ−1}{θ}` that we solve as :math:`θ = \frac{1}{1-τ}` """ + if self.tau == 1: + raise ValueError("Tau value can't be 1") + return 1 / (1 - self.tau)
Prevent ZeroDivisionError by raising a controlled ValueError
DAI-Lab_Copulas
train
py
cf06865ef674b8adbb7ac8cef3aead74d8d0d4f6
diff --git a/auto_ml/predictor.py b/auto_ml/predictor.py index <HASH>..<HASH> 100644 --- a/auto_ml/predictor.py +++ b/auto_ml/predictor.py @@ -914,6 +914,9 @@ class Predictor(object): n_jobs = -1 + if os.environ.get('is_test_suite', 0) == 'True': + n_jobs = 1 + gs = GridSearchCV( # Fit on the pipeline. ppl, @@ -1181,7 +1184,7 @@ class Predictor(object): if os.environ.get('is_test_suite', False) == 'True': # If this is the test_suite, do not run things in parallel - results = list(pool.map(lambda x: train_one_categorical_model(x[0], x[1], x[2]), categories_and_data)) + results = list(map(lambda x: train_one_categorical_model(x[0], x[1], x[2]), categories_and_data)) else: try: results = list(pool.map(lambda x: train_one_categorical_model(x[0], x[1], x[2]), categories_and_data))
reinstates one place for n_jobs=1 for is_test_suite
ClimbsRocks_auto_ml
train
py
3e7da2eb227a4e0875039b186246fdb7c30fcb2e
diff --git a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialChip.java b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialChip.java index <HASH>..<HASH> 100644 --- a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialChip.java +++ b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialChip.java @@ -60,7 +60,7 @@ import gwt.material.design.client.ui.html.Span; * @see <a href="https://material.io/guidelines/components/chips.html">Material Design Specification</a> */ //@formatter:on -public class MaterialChip extends AbstractTextWidget implements HasImage, HasIcon, HasLetter, +public class MaterialChip extends AbstractValueWidget<String> implements HasImage, HasIcon, HasLetter, HasValue<String>, HasCloseHandlers, HasType<ChipType> { private MaterialIcon icon = new MaterialIcon(IconType.CLOSE);
Reverted Chips to AbstractValueWidget.
GwtMaterialDesign_gwt-material
train
java
c2e8fa1e2a410181aad6ffefb7a443e4717cb510
diff --git a/auth_jwt_test.go b/auth_jwt_test.go index <HASH>..<HASH> 100644 --- a/auth_jwt_test.go +++ b/auth_jwt_test.go @@ -19,7 +19,7 @@ type DecoderToken struct { func makeTokenString(username string, key []byte) string { token := jwt.New(jwt.GetSigningMethod("HS256")) - token.Claims["id"] = "admin" + token.Claims["id"] = username token.Claims["exp"] = time.Now().Add(time.Hour).Unix() token.Claims["orig_iat"] = time.Now().Unix() tokenString, _ := token.SignedString(key) @@ -107,7 +107,7 @@ func TestAuthJWT(t *testing.T) { recorded = test.RunRequest(t, handler, expiredTimestampReq) recorded.CodeIs(401) recorded.ContentTypeIsJson() - + // right credt, right method, right priv, wrong signing method on request tokenBadSigning := jwt.New(jwt.GetSigningMethod("HS384")) tokenBadSigning.Claims["id"] = "admin"
change const value to variable on makeTokenString method.
StephanDollberg_go-json-rest-middleware-jwt
train
go
08ae41babdc6f7d17dd89ca0073cc1668a98113f
diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index <HASH>..<HASH> 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -260,7 +260,7 @@ def _convert_listlike_datetimes( Parameters ---------- arg : list, tuple, ndarray, Series, Index - date to be parced + date to be parsed name : object None or string for the Index name tz : object
Fiy Typo in datetimes (parced) (#<I>)
pandas-dev_pandas
train
py
29c4caff543b6311ff5df0fdb9aab0424343d817
diff --git a/hooks/papertrail/papertrail.go b/hooks/papertrail/papertrail.go index <HASH>..<HASH> 100644 --- a/hooks/papertrail/papertrail.go +++ b/hooks/papertrail/papertrail.go @@ -31,6 +31,7 @@ func NewPapertrailHook(host string, port int, appName string) (*PapertrailHook, func (hook *PapertrailHook) Fire(entry *logrus.Entry) error { defer hook.UDPConn.Close() date := time.Now().Format(format) + payload := fmt.Sprintf("<22> %s %s: [%s] %s", date, hook.AppName, entry.Data["level"], entry.Message) line, err := entry.String() if err != nil {
Log just the message, not the stringified version of the whole log line.
sirupsen_logrus
train
go
1ae5a1337bf885934e9d35d29f8b2941c48f9374
diff --git a/get_file.go b/get_file.go index <HASH>..<HASH> 100644 --- a/get_file.go +++ b/get_file.go @@ -18,8 +18,13 @@ func (g *FileGetter) ClientMode(u *url.URL) (ClientMode, error) { path = u.RawPath } + fi, err := os.Stat(path) + if err != nil { + return 0, err + } + // Check if the source is a directory. - if fi, err := os.Stat(path); err == nil && fi.IsDir() { + if fi.IsDir() { return ClientModeDir, nil } diff --git a/get_file_test.go b/get_file_test.go index <HASH>..<HASH> 100644 --- a/get_file_test.go +++ b/get_file_test.go @@ -166,6 +166,15 @@ func TestFileGetter_percent2F(t *testing.T) { } } +func TestFileGetter_ClientMode_notexist(t *testing.T) { + g := new(FileGetter) + + u := testURL("nonexistent") + if _, err := g.ClientMode(u); err == nil { + t.Fatal("expect source file error") + } +} + func TestFileGetter_ClientMode_file(t *testing.T) { g := new(FileGetter)
Error is returned early if file source does not exist
hashicorp_go-getter
train
go,go
17e02048c10e26e156ddcbcf8e1fce6fb0189269
diff --git a/tests/longSelect.go b/tests/longSelect.go index <HASH>..<HASH> 100644 --- a/tests/longSelect.go +++ b/tests/longSelect.go @@ -7,39 +7,16 @@ func main() { prompt := &survey.Select{ Message: "Choose a color:", Options: []string{ - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "red", - "blue", - "green", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", }, } survey.AskOne(prompt, &color, nil)
made longselect test more reasonable
AlecAivazis_survey
train
go
04b3ad9b4a507d05660c40fde162b5db9e701555
diff --git a/src/drag.js b/src/drag.js index <HASH>..<HASH> 100644 --- a/src/drag.js +++ b/src/drag.js @@ -5,6 +5,7 @@ module.exports = class Drag extends Plugin constructor(parent) { super(parent) + this.inMove = false } down(x, y, data) @@ -29,7 +30,7 @@ module.exports = class Drag extends Plugin { const distX = x - this.last.x const distY = y - this.last.y - if (this.parent.checkThreshold(distX) || this.parent.checkThreshold(distY)) + if (this.parent.checkThreshold(distX) || this.parent.checkThreshold(distY) || this.inMove) { this.parent.container.x += distX this.parent.container.y += distY @@ -37,6 +38,10 @@ module.exports = class Drag extends Plugin this.inMove = true } } + else + { + this.inMove = false + } } }
Smoothed dragging - Dragging is no longer choppy
davidfig_pixi-viewport
train
js
4a6fd4317a53ad78a669a37e4380ed71a032763e
diff --git a/server/server.go b/server/server.go index <HASH>..<HASH> 100644 --- a/server/server.go +++ b/server/server.go @@ -431,7 +431,7 @@ func (s *Server) AcceptLoop(clr chan struct{}) { conn, err := l.Accept() if err != nil { if ne, ok := err.(net.Error); ok && ne.Temporary() { - s.Debugf("Temporary Client Accept Error(%v), sleeping %dms", + s.Errorf("Temporary Client Accept Error (%v), sleeping %dms", ne, tmpDelay/time.Millisecond) time.Sleep(tmpDelay) tmpDelay *= 2 @@ -439,7 +439,7 @@ func (s *Server) AcceptLoop(clr chan struct{}) { tmpDelay = ACCEPT_MAX_SLEEP } } else if s.isRunning() { - s.Noticef("Accept error: %v", err) + s.Errorf("Client Accept Error: %v", err) } continue }
Change client Accept error log level This is an error users should know about. Thus, the log level should be error. Fixes #<I>
nats-io_gnatsd
train
go
55b6025f80770c738f764ef0ade50e96f2f44286
diff --git a/torrent.go b/torrent.go index <HASH>..<HASH> 100644 --- a/torrent.go +++ b/torrent.go @@ -637,7 +637,7 @@ func (t *Torrent) hashPiece(piece int) (ret metainfo.Hash) { return } if err != io.ErrUnexpectedEOF && !os.IsNotExist(err) { - log.Printf("unexpected error hashing piece with %T: %s", t.storage, err) + log.Printf("unexpected error hashing piece with %T: %s", t.storage.TorrentImpl, err) } return }
Log the storage TorrentImpl type
anacrolix_torrent
train
go
3fbf00ca1e449f15ea485df795f1f4c0f1fbff9c
diff --git a/dipper/sources/Source.py b/dipper/sources/Source.py index <HASH>..<HASH> 100644 --- a/dipper/sources/Source.py +++ b/dipper/sources/Source.py @@ -450,7 +450,7 @@ class Source: for field in line.findall('field'): atts = dict(field.attrib) row[atts['name']] = field.text - processing_function(line) + processing_function(row) line_counter += 1 if self.test_mode and limit is not None and line_counter > limit: continue
reconsider which of the previously clobbered 'row' to pass an an arg
monarch-initiative_dipper
train
py
83c3beea376d5d8c3af97409d7aceee2075a779b
diff --git a/lib/el_finder_s3/connector.rb b/lib/el_finder_s3/connector.rb index <HASH>..<HASH> 100755 --- a/lib/el_finder_s3/connector.rb +++ b/lib/el_finder_s3/connector.rb @@ -78,7 +78,6 @@ module ElFinderS3 def run(params) @adapter = ElFinderS3::Adapter.new(@options[:server], @options[:cache_connector]) - # @adapter = ElFinderS3::FtpAdapter.new(@options[:server]) @root = ElFinderS3::Pathname.new(adapter) begin diff --git a/lib/el_finder_s3/dummy_cache_client.rb b/lib/el_finder_s3/dummy_cache_client.rb index <HASH>..<HASH> 100644 --- a/lib/el_finder_s3/dummy_cache_client.rb +++ b/lib/el_finder_s3/dummy_cache_client.rb @@ -12,5 +12,9 @@ module ElFinderS3 def delete(key) nil end + + def exist?(key) + false + end end end
Added exists method to dummy_cache_client.rb
raulanatol_el_finder_s3
train
rb,rb
85bc03944f8e0081efce434e31865a4c7f53cca2
diff --git a/bitex/interfaces/rocktrading.py b/bitex/interfaces/rocktrading.py index <HASH>..<HASH> 100644 --- a/bitex/interfaces/rocktrading.py +++ b/bitex/interfaces/rocktrading.py @@ -48,7 +48,7 @@ class RockTradingLtd(RockTradingREST): return self.public_query('funds/%s/trades' % pair, params=kwargs) def _place_order(self, side, pair, price, size, **kwargs): - q = {'fund_id': pair, 'side': side, 'size': size, 'price': price} + q = {'fund_id': pair, 'side': side, 'amount': size, 'price': price} q.update(kwargs) return self.private_query('funds/%s/orders' % pair, method='POST', params=q) @@ -82,7 +82,7 @@ class RockTradingLtd(RockTradingREST): @return_api_response(fmt.withdraw) def withdraw(self, size, tar_addr, **kwargs): - q = {'destination_address': tar_addr, 'size': size} + q = {'destination_address': tar_addr, 'amount': size} q.update(kwargs) return self.private_query('atms/withdraw', params=q)
change the dictionary key names back to their original names
Crypto-toolbox_bitex
train
py
9ecae7c5fb9e33f50f5c6d95055643e2ce87d372
diff --git a/test/specs/controller.scatter.test.js b/test/specs/controller.scatter.test.js index <HASH>..<HASH> 100644 --- a/test/specs/controller.scatter.test.js +++ b/test/specs/controller.scatter.test.js @@ -3,6 +3,28 @@ describe('Chart.controllers.scatter', function() { expect(typeof Chart.controllers.scatter).toBe('function'); }); + it('should test default tooltip callbacks', function() { + var chart = window.acquireChart({ + type: 'scatter', + data: { + datasets: [{ + data: [{ + x: 10, + y: 15 + }], + label: 'dataset1' + }], + }, + options: {} + }); + var point = chart.getDatasetMeta(0).data[0]; + jasmine.triggerMouseEvent(chart, 'mousemove', point); + + // Title should be empty + expect(chart.tooltip._view.title.length).toBe(0); + expect(chart.tooltip._view.body[0].lines).toEqual(['(10, 15)']); + }); + describe('showLines option', function() { it('should not draw a line if undefined', function() { var chart = window.acquireChart({
Test default tooltip callbacks for scatter charts (#<I>) This moves the mouse over the drawn point and verifies that there is no title in the tooltip and that the body contains expected content.
chartjs_Chart.js
train
js
59f6685e2aa9abab55f44565e00056ea5771aea5
diff --git a/src/Middleware/InitStateMiddleware.php b/src/Middleware/InitStateMiddleware.php index <HASH>..<HASH> 100644 --- a/src/Middleware/InitStateMiddleware.php +++ b/src/Middleware/InitStateMiddleware.php @@ -44,8 +44,10 @@ class InitStateMiddleware implements HTTPMiddleware return $delegate($request); } catch (DatabaseException $ex) { $message = $ex->getMessage(); - if (strpos($message, 'No database selected') !== false) { - // Database is not ready, ignore and continue + if (strpos($message, 'No database selected') !== false + || preg_match('/\s*(table|relation) .* does(n\'t| not) exist/i', $message) + ) { + // Database is not ready, ignore and continue. Either it doesn't exist or it has no tables return $delegate($request); } throw $ex;
FIX Catching situation where database has no tables but it exists
silverstripe_silverstripe-subsites
train
php
079ad592b9ae341628f42aa1a282af1ca7b36c9b
diff --git a/chef/lib/chef/provider/package/rubygems.rb b/chef/lib/chef/provider/package/rubygems.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/package/rubygems.rb +++ b/chef/lib/chef/provider/package/rubygems.rb @@ -453,7 +453,11 @@ class Chef def install_via_gem_command(name, version) src = @new_resource.source && " --source=#{@new_resource.source} --source=http://rubygems.org" - shell_out!("#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \"#{version}\"#{src}#{opts}", :env=>nil) + if version + shell_out!("#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \"#{version}\"#{src}#{opts}", :env=>nil) + else + shell_out!("#{gem_binary_path} install #{name} -q --no-rdoc --no-ri #{src}#{opts}", :env=>nil) + end end def upgrade_package(name, version)
CHEF-<I> - gem version numbers are messy Now we only provide a version string to our alternative gem binary if we're actually provided with one. This allows gem_package#action_upgrade to work in the case where no version is specified.
chef_chef
train
rb
051916178d65523dd6479ca18e4e29e6e67820d2
diff --git a/lib/winston-azuretable.js b/lib/winston-azuretable.js index <HASH>..<HASH> 100644 --- a/lib/winston-azuretable.js +++ b/lib/winston-azuretable.js @@ -97,10 +97,11 @@ AzureLogger.prototype.log = function (level, msg, meta, callback) { if (meta) { for (var prop in meta) { + var propertyName = prop + '_'; if (typeof meta[prop] === 'object') { - data[prop] = { '_': JSON.stringify(meta[prop]) }; + data[propertyName] = { '_': JSON.stringify(meta[prop]) }; } else { - data[prop] = { '_': meta[prop] }; + data[propertyName] = { '_': meta[prop] }; } } }
Update winston-azuretable.js Handle duplicate property names in the entity to be logged.
jpoon_winston-azuretable
train
js
622a3bac0fb72e249c3cc95718204cd885640369
diff --git a/onnxmltools/convert/sparkml/ops_names.py b/onnxmltools/convert/sparkml/ops_names.py index <HASH>..<HASH> 100644 --- a/onnxmltools/convert/sparkml/ops_names.py +++ b/onnxmltools/convert/sparkml/ops_names.py @@ -4,6 +4,7 @@ Mapping and utility functions for Name to Spark ML operators ''' +from pyspark.ml import Transformer, Estimator from pyspark.ml.feature import Binarizer from pyspark.ml.feature import BucketedRandomProjectionLSHModel from pyspark.ml.feature import Bucketizer @@ -86,6 +87,12 @@ def get_sparkml_operator_name(model_type): :param model_type: A spark-ml object (LinearRegression, StringIndexer, ...) :return: A string which stands for the type of the input model in our conversion framework ''' + if not issubclass(model_type, Transformer): + if issubclass(model_type, Estimator): + raise ValueError("Estimator must be fitted before being converted to ONNX") + else: + raise ValueError("Unknown model type: {}".format(model_type)) + if model_type not in sparkml_operator_name_map: raise ValueError("No proper operator name found for '%s'" % model_type) return sparkml_operator_name_map[model_type]
fix: showing better error message when a model of wrong type is being passed. (#<I>)
onnx_onnxmltools
train
py
8b98ee1e8987a7ce0bfc14fd76b261edcbf804f5
diff --git a/code/VersionedDataObject.php b/code/VersionedDataObject.php index <HASH>..<HASH> 100644 --- a/code/VersionedDataObject.php +++ b/code/VersionedDataObject.php @@ -143,5 +143,13 @@ class VersionedDataObject extends Versioned parent::publish($fromStage, $toStage, $createNewVersion); $this->owner->extend('onAfterVersionedPublish', $fromStage, $toStage, $createNewVersion); } + + /** + * Improves interoperability with other components + * @return void + */ + public function doPublish() { + $this->publish('Stage','Live'); + } }
Makes this module work with scheduled publishing
heyday_silverstripe-versioneddataobjects
train
php
4eaec62687e4be30c64d026041579d0c471204f5
diff --git a/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js index <HASH>..<HASH> 100644 --- a/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js +++ b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js @@ -43,13 +43,12 @@ export default function ColorGradientLegend( width } /*: Props */ ) { - let colorDomain = colorScale.domain(); - let colorRange = colorScale.range(); - if (direction !== 1) { - colorDomain = colorDomain.reverse(); - colorRange = colorRange.reverse(); + const colorRange = colorScale.range(); + if (direction === 1) { + colorRange.reverse(); } + const colorDomain = colorScale.domain(); const lastColorIdx = colorRange.length - 1; const lastDomainIdx = colorDomain.length - 1; const widthNoPadding = width - padding[1];
Fix wrong treemap legend for coverage measure
SonarSource_sonarqube
train
js
23da83833afd21db225cf312f190e4ba1e86c11d
diff --git a/js/huobi.js b/js/huobi.js index <HASH>..<HASH> 100644 --- a/js/huobi.js +++ b/js/huobi.js @@ -1939,7 +1939,7 @@ module.exports = class huobi extends Exchange { if (limit !== undefined) { request['size'] = limit; // max 100 } - const response = await this.privateGetQueryDepositWithdraw (this.extend (request, params)); + const response = await this.spotPrivateGetV1QueryDepositWithdraw (this.extend (request, params)); // return response return this.parseTransactions (response['data'], currency, since, limit); } @@ -1963,7 +1963,7 @@ module.exports = class huobi extends Exchange { if (limit !== undefined) { request['size'] = limit; // max 100 } - const response = await this.privateGetQueryDepositWithdraw (this.extend (request, params)); + const response = await this.spotPrivateGetV1QueryDepositWithdraw (this.extend (request, params)); // return response return this.parseTransactions (response['data'], currency, since, limit); }
huobi fetchDeposits, fetchWithdrawals switched to new endpoint definitions
ccxt_ccxt
train
js
505655eb76eec7262f9a16f61b006c0f53d76a5d
diff --git a/umap/tests/test_parametric_umap.py b/umap/tests/test_parametric_umap.py index <HASH>..<HASH> 100644 --- a/umap/tests/test_parametric_umap.py +++ b/umap/tests/test_parametric_umap.py @@ -93,9 +93,9 @@ def test_save_load(): embedder = ParametricUMAP() embedding = embedder.fit_transform(X) - if platform.system() != "Windows": - # Portable tempfile - model_path = tempfile.mkdtemp(suffix="_umap_model") + # if platform.system() != "Windows": + # Portable tempfile + model_path = tempfile.mkdtemp(suffix="_umap_model") - embedder.save(model_path) - embedder = load_ParametricUMAP(model_path) + embedder.save(model_path) + embedder = load_ParametricUMAP(model_path)
Try restoring save-load test on windows
lmcinnes_umap
train
py
bcf54c88f00dc3ec4258eec44ca84003927c4c3f
diff --git a/library/CM/Usertext/Filter/MaxLength.php b/library/CM/Usertext/Filter/MaxLength.php index <HASH>..<HASH> 100644 --- a/library/CM/Usertext/Filter/MaxLength.php +++ b/library/CM/Usertext/Filter/MaxLength.php @@ -23,7 +23,7 @@ class CM_Usertext_Filter_MaxLength extends CM_Usertext_Filter_Abstract { $text = substr($text, 0, $this->_lengthMax); $lastBlank = strrpos($text, ' '); if ($lastBlank > 0) { - $text = substr($text, 0, $lastBlank); + $text = substr($text, 0, $lastBlank+1); } $text = $text . '…'; }
fixed missing space in MaxLength
cargomedia_cm
train
php
8bd551115cbe3eb89267fedaf8a191a3880f9d77
diff --git a/pulsar/client/test/check.py b/pulsar/client/test/check.py index <HASH>..<HASH> 100644 --- a/pulsar/client/test/check.py +++ b/pulsar/client/test/check.py @@ -208,7 +208,10 @@ def run(options): client_inputs = [] client_inputs.append(ClientInput(temp_input_path, CLIENT_INPUT_PATH_TYPES.INPUT_PATH)) client_inputs.append(ClientInput(temp_input_path, CLIENT_INPUT_PATH_TYPES.INPUT_PATH)) - client_inputs.append(ClientInput(empty_input, CLIENT_INPUT_PATH_TYPES.INPUT_PATH)) + # Reverting empty input handling added in: + # https://github.com/galaxyproject/pulsar/commit/2fb36ba979cf047a595c53cdef833cae79cbb380 + # Seems like it really should cause a failure. + # client_inputs.append(ClientInput(empty_input, CLIENT_INPUT_PATH_TYPES.INPUT_PATH)) client_inputs.append(ClientInput(os.path.join(temp_directory, "dataset_0_files"), CLIENT_INPUT_PATH_TYPES.INPUT_EXTRA_FILES_PATH)) client_inputs.append(ClientInput(temp_input_metadata_path, CLIENT_INPUT_PATH_TYPES.INPUT_METADATA_PATH)) output_files = [
Revert empty input testing, it really probably should cause a failure.
galaxyproject_pulsar
train
py
dc0e281bd5092138ccdca7c1b3e22c62e2cd2ea4
diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index <HASH>..<HASH> 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1004,7 +1004,8 @@ class Instruction: @StateTransition() def assert_fail_(self, global_state): - return [] + # 0xfe: designated invalid opcode + raise InvalidJumpDestination @StateTransition() def invalid_(self, global_state):
Add assert_fail_ implementation
ConsenSys_mythril-classic
train
py
6b3d9f8f86a066d003bff7003615448997483c6c
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index <HASH>..<HASH> 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -268,14 +268,14 @@ class BaseTest < ActiveSupport::TestCase end test "accessing inline attachments after mail was called works" do - class LateInlineAttachmentMailer < ActionMailer::Base + class LateInlineAttachmentAccessorMailer < ActionMailer::Base def welcome mail body: "yay", from: "welcome@example.com", to: "to@example.com" attachments.inline["invoice.pdf"] end end - assert_nothing_raised { LateInlineAttachmentMailer.welcome.message } + assert_nothing_raised { LateInlineAttachmentAccessorMailer.welcome.message } end test "adding inline attachments while rendering mail works" do
Do not use the same test class in different tests This fixes the following warnings. ``` actionmailer/test/base_test.rb:<I>: warning: method redefined; discarding old welcome actionmailer/test/base_test.rb:<I>: warning: previous definition of welcome was here ```
rails_rails
train
rb
ee631772cd5b08a51bab2d98cf0a0d01a2037d5d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -24,6 +24,10 @@ setup(name='salt', ['init/salt-minion', 'init/salt-master', ]), + ('/usr/libexec/salt', + ['libexec/clust-up', + 'libexec/clust-down', + ]), ], )
Add libexec scripts to the package
saltstack_salt
train
py
b851845c68cdf49cf7ed581e0b65496577547eed
diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index <HASH>..<HASH> 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -415,7 +415,7 @@ class DefaultController extends Base * Form validation for edit/create * @return bool */ - private function runFormValidation() + protected function runFormValidation() { $oFormValidation = Factory::service('FormValidation'); $aRulesFormValidation = []; @@ -440,7 +440,7 @@ class DefaultController extends Base * @param \stdClass $oItem The main item object * @return void */ - private function loadEditViewData($oItem = null) + protected function loadEditViewData($oItem = null) { $this->data['item'] = $oItem; } @@ -451,7 +451,7 @@ class DefaultController extends Base * Extract data from post variable * @return array */ - private function getPostObject() + protected function getPostObject() { $oInput = Factory::service('Input'); $aOut = [];
Changing visibility of methods in DefaultController to allow for overriding.
nails_module-admin
train
php
dac2330fefa18bb7f02993d00a68616ea80b70dd
diff --git a/scss/__init__.py b/scss/__init__.py index <HASH>..<HASH> 100644 --- a/scss/__init__.py +++ b/scss/__init__.py @@ -81,7 +81,11 @@ locate_blocks = None try: from scss._speedups import locate_blocks except ImportError: - sys.stderr.write("Scanning acceleration disabled (_speedups not found)!\n") + import warnings + warnings.warn( + "Scanning acceleration disabled (_speedups not found)!", + RuntimeWarning + ) from scss._native import locate_blocks ################################################################################
scss/__init__.py: raise RuntimeWarning instead of writing to sys.stderr when _speedups is not found
Kronuz_pyScss
train
py
c04fdc9a60efc85b1901b3ff4fe9fd2f0cc1a760
diff --git a/dask_ml/cluster/k_means.py b/dask_ml/cluster/k_means.py index <HASH>..<HASH> 100644 --- a/dask_ml/cluster/k_means.py +++ b/dask_ml/cluster/k_means.py @@ -447,7 +447,9 @@ def init_scalable( # to do that. if len(centers) < n_clusters: - logger.warning("Found fewer than %d clusters in init.", n_clusters) + logger.warning( + "Found fewer than %d clusters in init (found %d).", n_clusters, len(centers) + ) # supplement with random need = n_clusters - len(centers) locs = sorted(
Log amount of found clusters in kmeans init (#<I>) * Log amount of found clusters in kmeans init
dask_dask-ml
train
py
1d673c61ac1acece76604d2db83bdd810e9d70ea
diff --git a/lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php b/lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php @@ -208,6 +208,8 @@ class ProxyFactory $attributes[] = $field["fieldName"]; } + $attributes[] = $class->identifier; + return $attributes; }
fix handling of identifier when handling class properties in proxies
doctrine_phpcr-odm
train
php
9696d43ad5fc68a44adc3d06a89035e35dde8b9f
diff --git a/Drop-In/src/androidTest/java/com/braintreepayments/api/dropin/CreatePaymentMethodTest.java b/Drop-In/src/androidTest/java/com/braintreepayments/api/dropin/CreatePaymentMethodTest.java index <HASH>..<HASH> 100644 --- a/Drop-In/src/androidTest/java/com/braintreepayments/api/dropin/CreatePaymentMethodTest.java +++ b/Drop-In/src/androidTest/java/com/braintreepayments/api/dropin/CreatePaymentMethodTest.java @@ -468,7 +468,7 @@ public class CreatePaymentMethodTest extends BraintreePaymentActivityTestCase { waitForPaymentMethodList(); onView(withId(R.id.bt_payment_method_description)).check( - matches(withText("bt_buyer_us@paypal.com"))); + matches(withText("jane.doe@example.com"))); onView(withId(R.id.bt_select_payment_method_submit_button)).perform(click()); waitForActivity(activity);
Fix PayPal test due to test data change
braintree_braintree_android
train
java
cc182a3b1c2b840e8820081f1410d6dae301d54f
diff --git a/test/morph-stream.js b/test/morph-stream.js index <HASH>..<HASH> 100644 --- a/test/morph-stream.js +++ b/test/morph-stream.js @@ -37,6 +37,16 @@ test('morph promise into stream', assert => { })) }) +test('morph stream resolved by a promise', assert => { + assert.plan(1) + morph(new Promise(resolve => { + resolve(stream()) + })).pipe(concat(data => { + assert.equal(data.toString(), 'hello') + })) +}) + + test('should pass error to stream when promise throw an error', assert => { assert.plan(1) morph(new Promise((resolve, reject) => {
Should pipe stream returned by a promise
tether_morph-stream
train
js
f87bb0516c50236cc6bc111d3e2484da53a4c966
diff --git a/tinytag/tinytag.py b/tinytag/tinytag.py index <HASH>..<HASH> 100644 --- a/tinytag/tinytag.py +++ b/tinytag/tinytag.py @@ -24,6 +24,7 @@ # import codecs +import re import struct import os import io @@ -367,7 +368,7 @@ class ID3(TinyTag): extended = (header[3] & 0x40) > 0 experimental = (header[3] & 0x20) > 0 footer = (header[3] & 0x10) > 0 - size = self._calc_size(header[4:9], 7) + size = self._calc_size(header[4:8], 7) self._bytepos_after_id3v2 = size parsed_size = 0 if extended: # just read over the extended header. @@ -407,6 +408,9 @@ class ID3(TinyTag): return 0 frame = struct.unpack(binformat, frame_header_data) frame_id = self._decode_string(frame[0]) + # Stop parsing the frame if an invalid frame ID is found + if not re.match(r'[A-Z0-9]{3,4}', frame_id): + return 0 frame_size = self._calc_size(frame[1:1+frame_size_bytes], bits_per_byte) if frame_size > 0:
Fix MemoryError when parsing corrupted frame data -Frame ID is validated before trying to read its content
devsnd_tinytag
train
py
3eb2013b53ee51b708dee9b3e80625c71a9a8ece
diff --git a/chef/lib/chef/application.rb b/chef/lib/chef/application.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/application.rb +++ b/chef/lib/chef/application.rb @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +require 'socket' require 'chef/config' require 'chef/exceptions' require 'chef/log'
Chef::Application references constants from socket fixes undefined constant error when config file is missing
chef_chef
train
rb
31ed0c1fb06486c3ce1b05b62673b8d5a711817e
diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index <HASH>..<HASH> 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -141,7 +141,7 @@ class RemoteFilesystem } if ($this->progress) { - $this->io->write(''); + $this->io->overwrite(" Downloading: <comment>100%</comment>"); } if (false === $this->result) {
Fix progress display getting stuck at <I>%
mothership-ec_composer
train
php
158ace919a6f77da32de55bb67897e914a0a51c9
diff --git a/lib/routes/google.js b/lib/routes/google.js index <HASH>..<HASH> 100644 --- a/lib/routes/google.js +++ b/lib/routes/google.js @@ -7,7 +7,7 @@ module.exports = function(app){ var google = {}, grasshopper = require('grasshopper-core'), config = require('../config'), - redirectUrl = config.identities.google.redirectUrl; + redirectUrl = config.identities.google.redirectUrl || 'defaultRoute'; /** * Method will accept the oauth callback from google, run authentication, then redirect the user to the page that accepts the token.
Putting a default redirect url into the google auth rout so all will be chill.
grasshopper-cms_grasshopper-api-js
train
js
94f44654afb9f91acd63a6b76f578b5fbf4ec3d8
diff --git a/Imagine/Cache/Resolver/WebPathResolver.php b/Imagine/Cache/Resolver/WebPathResolver.php index <HASH>..<HASH> 100644 --- a/Imagine/Cache/Resolver/WebPathResolver.php +++ b/Imagine/Cache/Resolver/WebPathResolver.php @@ -117,7 +117,7 @@ class WebPathResolver implements ResolverInterface */ protected function getFileUrl($path, $filter) { - return $this->cachePrefix.'/'.$filter.'/'.$path; + return $this->cachePrefix.'/'.$filter.'/'.ltrim($path, '/'); } /**
Fix of #<I> (Trim of forwarding slash in path)
liip_LiipImagineBundle
train
php
b61e6d59c66d85eeb7478e98d8d0b54094cbb9c2
diff --git a/resources/route53-health-checks.go b/resources/route53-health-checks.go index <HASH>..<HASH> 100644 --- a/resources/route53-health-checks.go +++ b/resources/route53-health-checks.go @@ -2,10 +2,11 @@ package resources import ( "fmt" + + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/route53" "github.com/rebuy-de/aws-nuke/pkg/types" - "github.com/aws/aws-sdk-go/aws" ) func init() { @@ -17,7 +18,6 @@ func ListRoute53HealthChecks(sess *session.Session) ([]Resource, error) { params := &route53.ListHealthChecksInput{} resources := make([]Resource, 0) - for { resp, err := svc.ListHealthChecks(params) if err != nil { @@ -30,7 +30,7 @@ func ListRoute53HealthChecks(sess *session.Session) ([]Resource, error) { id: check.Id, }) } - if aws.BoolValue(resp.IsTruncated) != false { + if aws.BoolValue(resp.IsTruncated) == false { break } params.Marker = resp.NextMarker
fix Route<I>HealthCheck loop (#<I>)
rebuy-de_aws-nuke
train
go
cec3f114cdb41997ebee2cb18adbc76195887ca9
diff --git a/state/metrics.go b/state/metrics.go index <HASH>..<HASH> 100644 --- a/state/metrics.go +++ b/state/metrics.go @@ -146,7 +146,7 @@ func (m *MetricBatch) UUID() string { return m.doc.UUID } -// EnvUUID returns the environment uuid this metric applies to. +// EnvUUID returns the environment UUID this metric applies to. func (m *MetricBatch) EnvUUID() string { return m.doc.EnvUUID }
uuid -> UUID
juju_juju
train
go