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
62c6a2ce103f368c2322688de12c01cf90720751
diff --git a/lib/sfn/command/create.rb b/lib/sfn/command/create.rb index <HASH>..<HASH> 100644 --- a/lib/sfn/command/create.rb +++ b/lib/sfn/command/create.rb @@ -9,7 +9,6 @@ module Sfn include Sfn::CommandModule::Base include Sfn::CommandModule::Template include Sfn::CommandModule::Stack - include Sfn::CommandModule::Callbacks # Run the stack creation command def execute! diff --git a/lib/sfn/command/validate.rb b/lib/sfn/command/validate.rb index <HASH>..<HASH> 100644 --- a/lib/sfn/command/validate.rb +++ b/lib/sfn/command/validate.rb @@ -9,7 +9,6 @@ module Sfn include Sfn::CommandModule::Base include Sfn::CommandModule::Template include Sfn::CommandModule::Stack - include Sfn::CommandModule::Callbacks def execute! file = load_template_file
Remove explicit callback module loading (provided implicitly by base)
sparkleformation_sfn
train
rb,rb
33179ee175e1e76104fa6a620abd51a559fa042c
diff --git a/Schema/MySqlSchemaState.php b/Schema/MySqlSchemaState.php index <HASH>..<HASH> 100644 --- a/Schema/MySqlSchemaState.php +++ b/Schema/MySqlSchemaState.php @@ -67,7 +67,7 @@ class MySqlSchemaState extends SchemaState */ public function load($path) { - $process = $this->makeProcess('mysql --host=$LARAVEL_LOAD_HOST --port=$LARAVEL_LOAD_PORT --user=$LARAVEL_LOAD_USER --password=$LARAVEL_LOAD_PASSWORD --database=$LARAVEL_LOAD_DATABASE < $LARAVEL_LOAD_PATH'); + $process = $this->makeProcess('mysql --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"'); $process->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [ 'LARAVEL_LOAD_PATH' => $path,
change placeholder of load method (#<I>)
illuminate_database
train
php
c97ea1f2a98f81b266dbb4a78014c1be63b4c9b3
diff --git a/tests/test_main.py b/tests/test_main.py index <HASH>..<HASH> 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -749,6 +749,11 @@ def test_very_high_dpi(spoof_tesseract_cache, resources, outpdf): "Checks for a Decimal quantize error with high DPI, etc" check_ocrmypdf(resources / '2400dpi.pdf', outpdf, env=spoof_tesseract_cache) + pdfinfo = pdf_get_all_pageinfo(outpdf) + + image = pdfinfo[0]['images'][0] + assert image['dpi_w'] == image['dpi_h'] + assert image['dpi_w'] == 2400 def test_overlay(spoof_tesseract_noop, resources, outpdf):
Update high DPI test case to confirm the output image is not downsampled
jbarlow83_OCRmyPDF
train
py
1e137e432d814cbd5dbd20bf44594829c0598ca5
diff --git a/Swat/SwatDateEntry.php b/Swat/SwatDateEntry.php index <HASH>..<HASH> 100644 --- a/Swat/SwatDateEntry.php +++ b/Swat/SwatDateEntry.php @@ -396,7 +396,7 @@ class SwatDateEntry extends SwatInputControl implements SwatState } if ($all_empty) { - if ($this->required) { + if ($this->required && $this->isSensitive()) { $message = Swat::_('The %s field is required.'); $this->addMessage(new SwatMessage($message, SwatMessage::ERROR)); diff --git a/Swat/SwatTimeEntry.php b/Swat/SwatTimeEntry.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTimeEntry.php +++ b/Swat/SwatTimeEntry.php @@ -401,7 +401,7 @@ class SwatTimeEntry extends SwatInputControl implements SwatState } if ($all_empty) { - if ($this->required) { + if ($this->required && $this->isSensitive()) { $message = Swat::_('The %s field is required.'); $this->addMessage(new SwatMessage($message, SwatMessage::ERROR));
Ticket #<I>, TimeEntry and DateEntry now will not create an error message if they are both insensitive and required. svn commit r<I>
silverorange_swat
train
php,php
bafaca61a35482e1c728d95bf90d092430ef72e4
diff --git a/lib/specinfra/command/redhat/base/package.rb b/lib/specinfra/command/redhat/base/package.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/command/redhat/base/package.rb +++ b/lib/specinfra/command/redhat/base/package.rb @@ -1,5 +1,11 @@ class Specinfra::Command::Redhat::Base::Package < Specinfra::Command::Base::Package - + def check_installed(package, version=nil) + cmd = "rpm -q #{escape(package)}" + if version + cmd = "#{cmd} | grep -w -- #{escape(version)}" + end + cmd + end end
Add check_installed method to redhat/base/package
mizzy_specinfra
train
rb
2e917984b2a65744dee4248dd90902b355676c19
diff --git a/tests/Feature/Api/V1/Articles/FetchArticleResourceByAPITest.php b/tests/Feature/Api/V1/Articles/FetchArticleResourceByAPITest.php index <HASH>..<HASH> 100644 --- a/tests/Feature/Api/V1/Articles/FetchArticleResourceByAPITest.php +++ b/tests/Feature/Api/V1/Articles/FetchArticleResourceByAPITest.php @@ -154,7 +154,7 @@ class FetchArticleResourceByAPITest extends TestCase $this->allowPolicyAbility(ArticlePolicy::class, ['viewAny']); $user = $this->loginSPA(); - $articlesCount = mt_rand(4, 12); + $articlesCount = mt_rand(2, 5); $articles = Article::factory($articlesCount)->for($user)->create(); $response = $this->assertAuthenticated()
Update FetchArticleResourceByAPITest.php
russsiq_bixbite
train
php
46662e700bd20289503475770dbf0384e43398eb
diff --git a/context.go b/context.go index <HASH>..<HASH> 100644 --- a/context.go +++ b/context.go @@ -449,10 +449,10 @@ func (c *Context) SaveUploadedFile(file *multipart.FileHeader, dst string) error // Depending the "Content-Type" header different bindings are used: // "application/json" --> JSON binding // "application/xml" --> XML binding -// otherwise --> returns an error +// otherwise --> returns an error. // It parses the request's body as JSON if Content-Type == "application/json" using JSON or XML as a JSON input. // It decodes the json payload into the struct specified as a pointer. -// It will writes a 400 error and sets Content-Type header "text/plain" in the response if input is not valid. +// It writes a 400 error and sets Content-Type header "text/plain" in the response if input is not valid. func (c *Context) Bind(obj interface{}) error { b := binding.Default(c.Request.Method, c.ContentType()) return c.MustBindWith(obj, b)
Doc: Fix typo in documentation of Bind (#<I>)
gin-gonic_gin
train
go
861cc312fa169730d3f1ae5993961d83724de052
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ScopeP.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ScopeP.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ScopeP.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/ScopeP.java @@ -48,7 +48,7 @@ public final class ScopeP<V> extends P<V> { @Override public boolean test(final V testValue) { - return this.biPredicate.test(testValue, this.value); + return this.value == null || this.biPredicate.test(testValue, this.value); } @Override
ScopeP allows the object to flow through when nothing binds to the scope variable.
apache_tinkerpop
train
java
337a9492101019dc7a0f0ff883af42344b8ba978
diff --git a/Concerns/ManagesTransactions.php b/Concerns/ManagesTransactions.php index <HASH>..<HASH> 100644 --- a/Concerns/ManagesTransactions.php +++ b/Concerns/ManagesTransactions.php @@ -117,6 +117,8 @@ trait ManagesTransactions protected function createTransaction() { if ($this->transactions == 0) { + $this->reconnectIfMissingConnection(); + try { $this->getPdo()->beginTransaction(); } catch (Exception $e) {
Reconnect missing connection when beginning transaction (#<I>)
illuminate_database
train
php
6e9f6ecbe7cbf0ff7e490cbf7c6dc2444bd15538
diff --git a/src/brackets.js b/src/brackets.js index <HASH>..<HASH> 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -124,7 +124,7 @@ define(function (require, exports, module) { require("editor/EditorCommandHandlers"); require("editor/EditorOptionHandlers"); require("help/HelpCommandHandlers"); - require("search/FindInFiles"); + require("search/FindInFilesUI"); require("search/FindReplace"); require("extensibility/InstallExtensionDialog"); require("extensibility/ExtensionManagerDialog");
Directly include FindInFilesUI instead of FindInFiles, since the former now registers the commands
adobe_brackets
train
js
2ac193da2377eeebd15e1d5a74009177d5ccab7a
diff --git a/options_filter.go b/options_filter.go index <HASH>..<HASH> 100644 --- a/options_filter.go +++ b/options_filter.go @@ -8,7 +8,8 @@ import "strings" // OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method // and provides the response with a set of allowed methods for the request URL Path. -// As for any filter, you can also install it for a particular WebService within a Container +// As for any filter, you can also install it for a particular WebService within a Container. +// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) { if "OPTIONS" != req.Request.Method { chain.ProcessFilter(req, resp) @@ -19,6 +20,7 @@ func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterCha // OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method // and provides the response with a set of allowed methods for the request URL Path. +// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). func OPTIONSFilter() FilterFunction { return DefaultContainer.OPTIONSFilter }
add comment to OPTIONSFilter, Issue #<I>
emicklei_go-restful
train
go
26978e3ce84eda4e659fe9724e89c51efdd01781
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index <HASH>..<HASH> 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1609,7 +1609,7 @@ module ActiveRecord :class_name, :table_name, :join_table, :foreign_key, :association_foreign_key, :select, :conditions, :include, :order, :group, :limit, :offset, :uniq, - :finder_sql, :delete_sql, :insert_sql, + :finder_sql, :counter_sql, :delete_sql, :insert_sql, :before_add, :after_add, :before_remove, :after_remove, :extend, :readonly, :validate
Added :counter_sql as a valid key for habtm associations
rails_rails
train
rb
c8d61397adcb84a83dd87345e3a1eb81dcefcff8
diff --git a/src/com/opencms/file/CmsObject.java b/src/com/opencms/file/CmsObject.java index <HASH>..<HASH> 100755 --- a/src/com/opencms/file/CmsObject.java +++ b/src/com/opencms/file/CmsObject.java @@ -1,7 +1,7 @@ /* * File : $Source: /alkacon/cvs/opencms/src/com/opencms/file/Attic/CmsObject.java,v $ -* Date : $Date: 2001/12/07 09:47:43 $ -* Version: $Revision: 1.210 $ +* Date : $Date: 2001/12/07 10:31:06 $ +* Version: $Revision: 1.211 $ * * This library is part of OpenCms - * the Open Source Content Mananagement System @@ -51,7 +51,7 @@ import com.opencms.template.cache.*; * @author Michaela Schleich * @author Michael Emmerich * - * @version $Revision: 1.210 $ $Date: 2001/12/07 09:47:43 $ + * @version $Revision: 1.211 $ $Date: 2001/12/07 10:31:06 $ * */ public class CmsObject implements I_CmsConstants { @@ -1687,6 +1687,13 @@ public com.opencms.launcher.CmsLauncherManager getLauncherManager() { } /** + * + */ + public boolean isStaticExportEnabled(){ + return OpenCms.isStaticExportEnabled(); + } + + /** * Returns the mode this cmsObject is runnig in. AUTO mode (-1) means * it is no special case and returns online ore offline depending on the * current project.
New method to check if static export is enabled.
alkacon_opencms-core
train
java
221664e911735a2711d8dba06dd021ca7b7733f4
diff --git a/tsconvert.js b/tsconvert.js index <HASH>..<HASH> 100755 --- a/tsconvert.js +++ b/tsconvert.js @@ -541,12 +541,12 @@ function parseConstructorFunction(node, selfTypeRef, instanceTypeParams) { current_scope = new TTypeParameterScope(current_scope) var typeParams = [] instanceTypeParams.forEach(function(tp,index) { - current_scope.put(tp.name, new TTypeParam(tp.name)) + current_scope.env.put(tp.name, new TTypeParam(tp.name)) typeParams.push(tp) }) node.typeArguments && node.typeArguments.members.forEach(function (tp,index) { var name = tp.name.text() - current_scope.put(name, new TTypeParam(name)) + current_scope.env.put(name, new TTypeParam(name)) typeParams.push(parseTypeParameter(tp)) }) var t = {
bugfix in constructors with generics
asgerf_tscheck
train
js
dfb1294674fd1a576cea292ee92034e6907a1c29
diff --git a/test/i_object_info_test.rb b/test/i_object_info_test.rb index <HASH>..<HASH> 100644 --- a/test/i_object_info_test.rb +++ b/test/i_object_info_test.rb @@ -6,8 +6,8 @@ module GirFFI setup do gir = IRepository.default - gir.require 'Everything', nil - @info = gir.find_by_name 'Everything', 'TestObj' + gir.require 'Regress', nil + @info = gir.find_by_name 'Regress', 'TestObj' end should "find a vfunc by name" do
Make tests in IObjectInfoTest pass by changing Everything to Regress.
mvz_gir_ffi
train
rb
a3f66a45977f95274ede281a6994350352b5fd36
diff --git a/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go b/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go +++ b/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go @@ -428,7 +428,7 @@ func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error { if s.ShutdownSendRetryAfter { // when this mode is enabled, we do the following: // - the server will continue to listen until all existing requests in flight - // (not including active long runnning requests) have been drained. + // (not including active long running requests) have been drained. // - once drained, http Server Shutdown is invoked with a timeout of 2s, // net/http waits for 1s for the peer to respond to a GO_AWAY frame, so // we should wait for a minimum of 2s
fix typo in genericapiserver.go runnning -> running
kubernetes_kubernetes
train
go
326e18c674da6768065306b5e861a2576b57cd07
diff --git a/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocument.java b/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocument.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocument.java +++ b/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODocument.java @@ -846,14 +846,17 @@ public class ODocument extends ORecordVirtualAbstract<Object> implements Iterabl /** * Internal. + * + * @return */ - public void addOwner(final ORecordElement iOwner) { + public ODocument addOwner(final ORecordElement iOwner) { if (_owners == null) _owners = new ArrayList<WeakReference<ORecordElement>>(); this._owners.add(new WeakReference<ORecordElement>(iOwner)); + return this; } - public void removeOwner(final ORecordElement iRecordElement) { + public ODocument removeOwner(final ORecordElement iRecordElement) { if (_owners != null) { // PROPAGATES TO THE OWNER ORecordElement e; @@ -865,6 +868,7 @@ public class ODocument extends ORecordVirtualAbstract<Object> implements Iterabl } } } + return this; } /**
Added fluent interface to owners methods
orientechnologies_orientdb
train
java
1882a2ae472a4fcdf846756f63460ef720c8df61
diff --git a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php +++ b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php @@ -82,6 +82,12 @@ class DbalLogger implements SQLLogger private function normalizeParams(array $params) { foreach ($params as $index => $param) { + // normalize recursively + if (is_array($param)) { + $params[$index] = $this->normalizeParams($param); + continue; + } + if (!is_string($params[$index])) { continue; }
Normalizing recursively - see #<I>
symfony_symfony
train
php
849dae7d8d942cc590320c951b77df168cba5ddd
diff --git a/lib/connect-loki.js b/lib/connect-loki.js index <HASH>..<HASH> 100644 --- a/lib/connect-loki.js +++ b/lib/connect-loki.js @@ -69,7 +69,7 @@ module.exports = (session) => { this.client.loadDatabase({}, () => { self.collection = self.client.getCollection('Sessions'); - if(_.isNil(self.Sessions)) { + if(_.isNil(self.collection)) { self.collection = self.client.addCollection('Sessions', { indices: ['sid'], ttlInterval: self.ttl
checking for nil collection and then creating a new one
Requarks_connect-loki
train
js
cd32ffdfdb37ff2a3044bcb9c44dc4d4bee21111
diff --git a/xmantissa/test/test_rendertools.py b/xmantissa/test/test_rendertools.py index <HASH>..<HASH> 100644 --- a/xmantissa/test/test_rendertools.py +++ b/xmantissa/test/test_rendertools.py @@ -19,21 +19,25 @@ class LivePageRendererTestCase(TestCase): """ message = 'Hello, world.' - docFactory = stan(p(render=directive('liveElement'))[message]) + + def docFactory(self, renderer, message): + return stan(p(render=directive(renderer))[message]) def testRenderLiveFragment(self): """ Test that L{render} spits out the right thing for a L{LiveFragment}. """ + docFactory = self.docFactory('liveFragment', self.message) self.assertIn( self.message, - renderLiveFragment(LiveFragment(docFactory=self.docFactory))) + renderLiveFragment(LiveFragment(docFactory=docFactory))) def testRenderLiveElement(self): """ Test that L{render} spits out the right thing for a L{LiveElement}. """ + docFactory = self.docFactory('liveElement', self.message) self.assertIn( self.message, - renderLiveFragment(LiveElement(docFactory=self.docFactory))) + renderLiveFragment(LiveElement(docFactory=docFactory)))
Merge rendertools-<I> Author: exarkun Reviewer: washort Fixes #<I> Use the liveFragment renderer for fragments and the liveElement renderer for elements, instead of using the liveElement renderer for anything.
twisted_mantissa
train
py
3d7db06523b94f26c2e0ca1a3be634552939261b
diff --git a/lib/sensu/server.rb b/lib/sensu/server.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/server.rb +++ b/lib/sensu/server.rb @@ -135,9 +135,7 @@ module Sensu handler_name end end - handler_list.flatten! - handler_list.uniq! - handlers = handler_list.map do |handler_name| + handlers = handler_list.flatten.uniq.map do |handler_name| if @settings.handler_exists?(handler_name) handler = @settings[:handlers][handler_name].merge(:name => handler_name) if handler.has_key?(:severities) @@ -166,6 +164,7 @@ module Sensu handler else @logger.warn('unknown handler', { + :event => event, :handler => { :name => handler_name }
[execute] removed a few destructive methods
sensu_sensu
train
rb
b12566c16bfcfed01dabf094e081f2a74f5caf39
diff --git a/src/effector/fork.js b/src/effector/fork.js index <HASH>..<HASH> 100644 --- a/src/effector/fork.js +++ b/src/effector/fork.js @@ -71,7 +71,7 @@ function universalLaunch(unit, payload) { launch(unit, payload) } } -export function fork(domain) { +export function fork(domain, {values = {}} = {}) { if (!is.domain(domain)) throw Error('first argument of fork should be domain') if (!domain.graphite.meta.withScopes) { domain.graphite.meta.withScopes = true @@ -89,7 +89,7 @@ export function fork(domain) { } }) } - return cloneGraph(domain) + return cloneGraph(domain, {values}) } export function allSettled(start, {scope: {clones, find}, params: ctx}) { const defer = new Defer() @@ -165,7 +165,7 @@ function flatGraph(unit) { everything we need to clone graph section reachable from given unit */ -function cloneGraph(unit) { +function cloneGraph(unit, {values}) { const list = flatGraph(unit) const refs = new Map() @@ -201,7 +201,7 @@ function cloneGraph(unit) { if (!newRef) { newRef = { id: ref.id, - current: ref.current, + current: ref.id in values ? values[ref.id] : ref.current, } refs.set(ref, newRef) }
allow to hydrate during a fork
zerobias_effector
train
js
726e8daf68888be4ad4cdf1ece981e0cd2a0309a
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -129,7 +129,7 @@ Parser.prototype.parse = function(key, defaultValue) { var ns = _.isString(options.ns) ? options.ns : options.ns.defaultNs; console.assert(_.isString(ns) && !!ns.length, 'ns is not a valid string', ns); - if (key.indexOf(options.nsseparator) > -1) { + if (typeof options.nsseparator === 'string' && key.indexOf(options.nsseparator) > -1) { var parts = key.split(options.nsseparator); ns = parts[0]; key = parts[1];
#<I> Add support to disable the keyseparator
i18next_i18next-scanner
train
js
e3f920d2f147025634e12abd5af3a84f436ddad1
diff --git a/api/types/swarm/secret.go b/api/types/swarm/secret.go index <HASH>..<HASH> 100644 --- a/api/types/swarm/secret.go +++ b/api/types/swarm/secret.go @@ -13,7 +13,7 @@ type Secret struct { type SecretSpec struct { Annotations Data []byte `json:",omitempty"` - Driver *Driver `json:"omitempty"` // name of the secrets driver used to fetch the secret's value from an external secret store + Driver *Driver `json:",omitempty"` // name of the secrets driver used to fetch the secret's value from an external secret store } // SecretReferenceFileTarget is a file target in a secret reference
pluggable secret backend Fixing secret driver serialization issue from <I>f7cf<I>a0dd8e4c<I>a4cc<I>fdf<I>d<I>f2
moby_moby
train
go
406f350954cd46f655f4df08ea0fdb610ff61dd1
diff --git a/networking_arista/l3Plugin/l3_arista.py b/networking_arista/l3Plugin/l3_arista.py index <HASH>..<HASH> 100644 --- a/networking_arista/l3Plugin/l3_arista.py +++ b/networking_arista/l3Plugin/l3_arista.py @@ -14,12 +14,12 @@ import copy -from neutron.common import rpc as n_rpc from neutron_lib.agent import topics from neutron_lib import constants as n_const from neutron_lib import context as nctx from neutron_lib.plugins import constants as plugin_constants from neutron_lib.plugins import directory +from neutron_lib import rpc as n_rpc from neutron_lib.services import base as service_base from neutron_lib import worker from oslo_config import cfg
use neutron-lib for rpc This patch switches the code over to use neutron-lib's rpc module rather than neutrons. Change-Id: Icb<I>cf<I>d<I>a<I>b3fa<I>fe8d2b<I>f<I>e6
openstack_networking-arista
train
py
6618c666cda07a73efde5033f5bffa42d65539a6
diff --git a/lib/http-server.js b/lib/http-server.js index <HASH>..<HASH> 100644 --- a/lib/http-server.js +++ b/lib/http-server.js @@ -39,7 +39,7 @@ HTTPServer.prototype.start = function () { self.log('['.grey+'served'.yellow+'] '.grey + request.url); return self.file.serve(request, response); }); - }).listen(self.port, self.host); + }).listen(self.port); self.log('http-server successfully started: '.green + 'http://'.cyan + self.host.cyan
[api] Removed host option for now
cubbles_cubx-http-server
train
js
9a5daba51abdac7ff260059b712ba5e5487e781b
diff --git a/sentry_sdk/integrations/logging.py b/sentry_sdk/integrations/logging.py index <HASH>..<HASH> 100644 --- a/sentry_sdk/integrations/logging.py +++ b/sentry_sdk/integrations/logging.py @@ -157,7 +157,6 @@ class EventHandler(logging.Handler, object): if hub.client is None: return - hint = None # type: Optional[Dict[str, Any]] client_options = hub.client.options # exc_info might be None or (None, None, None) @@ -169,7 +168,7 @@ class EventHandler(logging.Handler, object): ) elif record.exc_info and record.exc_info[0] is None: event = {} - hint = None + hint = {} with capture_internal_exceptions(): event["threads"] = { "values": [ @@ -184,6 +183,9 @@ class EventHandler(logging.Handler, object): } else: event = {} + hint = {} + + hint["log_record"] = record event["level"] = _logging_to_event_level(record.levelname) event["logger"] = record.name
feat: Add log_record to event hints See #<I>
getsentry_sentry-python
train
py
e05452d84b56823dcbef04629a3e40a4467702f2
diff --git a/lib/launchpad/device.rb b/lib/launchpad/device.rb index <HASH>..<HASH> 100644 --- a/lib/launchpad/device.rb +++ b/lib/launchpad/device.rb @@ -433,19 +433,19 @@ module Launchpad # # [Launchpad::NoValidBrightnessError] when brightness values aren't within the valid range def velocity(opts) - color = if opts.is_a?(Hash) + if opts.is_a?(Hash) red = brightness(opts[:red] || 0) green = brightness(opts[:green] || 0) - 16 * green + red + color = 16 * green + red + flags = case opts[:mode] + when :flashing then 8 + when :buffering then 0 + else 12 + end + color + flags else - opts.to_i + opts.to_i + 12 end - flags = case opts[:mode] - when :flashing then 8 - when :buffering then 0 - else 12 - end - color + flags end # Calculates the integer brightness for given brightness values.
Fix handling of integer velocities in Ruby <I> It's assumed that flags have already been taken care of if we've been passed a non-hash (probably Integer). This fixes examples/color_picker.rb
thomasjachmann_launchpad
train
rb
692c4719c5b8075713210396dccac775a9fb8757
diff --git a/lib/step.js b/lib/step.js index <HASH>..<HASH> 100755 --- a/lib/step.js +++ b/lib/step.js @@ -109,7 +109,7 @@ function Step() { error = arguments[0]; } // Send the other results as arguments - result[i + 1] = arguments[1]; + result[i] = arguments[1]; if (lock) { process.nextTick(check); return
Fix an off-by-one error in the new group function.
creationix_step
train
js
405432952368c90f707bc6cf753311bca1c043bc
diff --git a/test/mouse-events.js b/test/mouse-events.js index <HASH>..<HASH> 100644 --- a/test/mouse-events.js +++ b/test/mouse-events.js @@ -2,6 +2,7 @@ describe('Mouse Events', function () { var fixture = document.createElement('div'); + document.body.appendChild(fixture); describe('click', function () { it('should trigger', function () {
Fix broken test in IE<I>. It's not clear why this fixes the test; the actual error is known and not fixed/understood: <URL>
blakeembrey_simulate-event
train
js
9b35a51bac41359ffef3ec6573c5470a47560d94
diff --git a/reactfx/src/main/java/org/reactfx/util/FingerTree.java b/reactfx/src/main/java/org/reactfx/util/FingerTree.java index <HASH>..<HASH> 100644 --- a/reactfx/src/main/java/org/reactfx/util/FingerTree.java +++ b/reactfx/src/main/java/org/reactfx/util/FingerTree.java @@ -29,6 +29,13 @@ public abstract class FingerTree<T, S> { public abstract S getSummary(); + public Tuple3<FingerTree<T, S>, T, FingerTree<T, S>> splitAt(int leaf) { + Lists.checkIndex(leaf, getLeafCount()); + return split0(leaf).map((l, r0) -> + r0.split0(1).map((m, r) -> + t(l, m.getLeaf0(0), r))); + } + public Tuple3<FingerTree<T, S>, Tuple2<T, Integer>, FingerTree<T, S>> split( ToIntFunction<? super S> metric, int position) { Lists.checkPosition(position, measure(metric));
Add method NonEmptyFingerTree.splitAt(leaf).
TomasMikula_ReactFX
train
java
4709936d123e915998d3afaf0ffd0cf7a3e0af60
diff --git a/gdax/order_book.py b/gdax/order_book.py index <HASH>..<HASH> 100644 --- a/gdax/order_book.py +++ b/gdax/order_book.py @@ -29,6 +29,13 @@ class OrderBook(WebsocketClient): ''' Currently OrderBook only supports a single product even though it is stored as a list of products. ''' return self.products[0] + def on_open(self): + self._sequence = -1 + print("-- Subscribed to OrderBook! --\n") + + def on_close(self): + print("\n-- OrderBook Socket Closed! --") + def on_message(self, message): if self._log_to: pickle.dump(message, self._log_to)
Re-initialize OrderBook on open If OrderBook is closed, then reopened, the accuracy of the data can no longer be trusted. Setting _sequence = -1 on open resets the _asks and _bids members as well so we can start with a fresh and accurate OrderBook.
danpaquin_coinbasepro-python
train
py
3a8c38ca4114586978a2ff91e9db0e353ac05672
diff --git a/rbd/rbd.go b/rbd/rbd.go index <HASH>..<HASH> 100644 --- a/rbd/rbd.go +++ b/rbd/rbd.go @@ -17,7 +17,7 @@ import ( ) const ( - // RBD features + // RBD features. RbdFeatureLayering uint64 = 1 << iota RbdFeatureStripingV2 RbdFeatureExclusiveLock @@ -28,6 +28,34 @@ const ( RbdFeatureDataPool RbdFeatureOperations RbdFeatureMigrating + + // Features that make an image inaccessible for read or write by clients that don't understand + // them. + RbdFeaturesIncompatible = RbdFeatureLayering | + RbdFeatureStripingV2 | + RbdFeatureDataPool + + // Features that make an image unwritable by clients that don't understand them. + RbdFeaturesRwIncompatible = RbdFeaturesIncompatible | + RbdFeatureExclusiveLock | + RbdFeatureObjectMap | + RbdFeatureFastDiff | + RbdFeatureDeepFlatten | + RbdFeatureJournaling | + RbdFeatureOperations | + RbdFeatureMigrating + + // Features that may be dynamically enabled or disabled. + RbdFeaturesMutable = RbdFeatureExclusiveLock | + RbdFeatureObjectMap | + RbdFeatureFastDiff | + RbdFeatureJournaling + + // Features that only work when used with a single client using the image for writes. + RbdFeaturesSingleClient = RbdFeatureExclusiveLock | + RbdFeatureObjectMap | + RbdFeatureFastDiff | + RbdFeatureJournaling ) //
Add RBD feature flag sets as per Python rbd module
ceph_go-ceph
train
go
4ddf93baa5838c7d1a3adbed041df0ced33b8d1c
diff --git a/common-methods.go b/common-methods.go index <HASH>..<HASH> 100644 --- a/common-methods.go +++ b/common-methods.go @@ -113,10 +113,20 @@ func getNewClient(urlStr string, auth *hostConfig) (clnt client.Client, err erro return nil, iodine.New(errInvalidArgument{}, nil) } s3Config := new(s3.Config) - s3Config.AccessKeyID = auth.AccessKeyID - s3Config.SecretAccessKey = auth.SecretAccessKey + s3Config.AccessKeyID = func() string { + if auth.AccessKeyID == globalAccessKeyID { + return "" + } + return auth.AccessKeyID + }() + s3Config.SecretAccessKey = func() string { + if auth.SecretAccessKey == globalSecretAccessKey { + return "" + } + return auth.SecretAccessKey + }() s3Config.AppName = "Minio" - s3Config.AppVersion = Version + s3Config.AppVersion = getVersion() s3Config.AppComments = []string{os.Args[0], runtime.GOOS, runtime.GOARCH} s3Config.HostURL = urlStr s3Config.Debug = globalDebugFlag
Make sure the AppVersion set is a proper formatted time string
minio_mc
train
go
9845cbb13d264f6b5b2f9bf78a2766ea5fb1132f
diff --git a/lib/record.js b/lib/record.js index <HASH>..<HASH> 100644 --- a/lib/record.js +++ b/lib/record.js @@ -59,7 +59,7 @@ function Record(name, level, args) { } this.exception = isErr; this.uncaughtException = isErr ? trace[UNCAUGHT_SYMBOL] : undefined; - this.stack = trace ? stack(trace) : undefined; + this.stack = trace && trace.stack ? stack(trace) : undefined; } diff --git a/test/logger.js b/test/logger.js index <HASH>..<HASH> 100644 --- a/test/logger.js +++ b/test/logger.js @@ -202,6 +202,19 @@ module.exports = { assert(obj[0].fileName); assert.equal(record.exception, true); }, + 'should be with empty stack if NONE err.stack': function(){ + var a = new Logger(unique()); + a.propagate = false; + var spyA = spy(); + a.addHandler({ handle: spyA, level: 0 }); + + var error = new Error('foo'); + delete error.stack; + a.error(error); + + var record = spyA.getLastArgs()[0]; + assert.equal(record.stack, undefined); + }, 'ALL should receive all levels': function() { var a = new Logger(unique()); a.propagate = false;
check err.stack on record
seanmonstar_intel
train
js,js
a94dac243e902da955779cb78063c201f0d55326
diff --git a/spec/integration/parser/catalog_spec.rb b/spec/integration/parser/catalog_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/parser/catalog_spec.rb +++ b/spec/integration/parser/catalog_spec.rb @@ -113,12 +113,14 @@ describe "A catalog" do end def master_and_agent_catalogs_for(manifest) - # The compiler creates a context, but does not apply it on every operation - # (except compilation). + # There are issues with this sequence, the compilation via the indirector work + # as expected, it sets up the context and compiles. The second use of the catalog, + # to convert it again goes into initial_import, and performs evaluation but without + # a fully configured context. # compiler = Puppet::Resource::Catalog::Compiler.new - master_catalog = compiler.filter(compile_to_catalog(manifest)) - agent_catalog = Puppet::Resource::Catalog.convert_from(:pson, master_catalog.render(:pson)) + master_catalog = compiler.filter(compile_to_catalog(manifest)) + agent_catalog = Puppet::Resource::Catalog.convert_from(:pson, master_catalog.render(:pson)) [master_catalog, agent_catalog] end
(maint) Improve comment and formatting in test.
puppetlabs_puppet
train
rb
5f9c0bca49173531156cdddcf75b553bf41951e6
diff --git a/salt/output/highstate.py b/salt/output/highstate.py index <HASH>..<HASH> 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -122,14 +122,20 @@ def _format_host(host, data): if comps[1] != comps[2]: state_lines.insert( 3, ' {tcolor} Name: {comps[2]}{colors[ENDC]}') + try: + comment = ret['comment'].strip().replace( + '\n', + '\n' + ' ' * 14) + except AttributeError: + comment = ret['comment'].join(' ').replace( + '\n', + '\n' + ' ' * 13) svars = { 'tcolor': tcolor, 'comps': comps, 'ret': ret, + 'comment': comment, # This nukes any trailing \n and indents the others. - 'comment': ret['comment'].strip().replace( - '\n', - '\n' + ' ' * 14), 'colors': colors } hstrs.extend([sline.format(**svars) for sline in state_lines])
Fix highstate output Refs #<I>
saltstack_salt
train
py
94000922b61fbeba1638c4be1782b0a2811d24fe
diff --git a/lib/chap/version.rb b/lib/chap/version.rb index <HASH>..<HASH> 100644 --- a/lib/chap/version.rb +++ b/lib/chap/version.rb @@ -1,3 +1,3 @@ module Chap - VERSION = "0.0.6" + VERSION = "0.0.7" end
<I> add support for syncing restart
tongueroo_chap
train
rb
55bd98f42b41707b831cbf3bdfccd2fe72f5647b
diff --git a/buildExample.js b/buildExample.js index <HASH>..<HASH> 100644 --- a/buildExample.js +++ b/buildExample.js @@ -1,7 +1,7 @@ import React from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { writeFileSync, readFileSync } from 'fs'; -import { map, toPairs } from 'lodash/fp'; +import { map, toPairs, sortBy } from 'lodash/fp'; import path from 'path'; import * as icons from './dist'; @@ -19,7 +19,7 @@ function IconList() { <Icon className="icon" /> </IconWrapper> ), - toPairs(icons) + sortBy(([name]) => name, toPairs(icons)) )} </div> );
chore(example): sort icons by name
lucastobrazil_cabanaico
train
js
c285b8ff1f451efe6305895d3ca98b1bd80a728f
diff --git a/lib/roo_on_rails/railties/http.rb b/lib/roo_on_rails/railties/http.rb index <HASH>..<HASH> 100644 --- a/lib/roo_on_rails/railties/http.rb +++ b/lib/roo_on_rails/railties/http.rb @@ -17,7 +17,7 @@ module RooOnRails ::Rack::Timeout ) - middleware_to_insert_before = defined?('Rack::Head') ? Rack::Head : ActionDispatch::Cookies + middleware_to_insert_before = defined?('Rack::Head') ? ::Rack::Head : ::ActionDispatch::Cookies # This needs to be inserted low in the stack, before Rails returns the # thread-current connection to the pool.
Make it smarter about picking middleware
deliveroo_roo_on_rails
train
rb
2cf54a4313912eb88369215744a042ef7dadfbbf
diff --git a/src/Alexdover/BladeSet/BladeSetServiceProvider.php b/src/Alexdover/BladeSet/BladeSetServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Alexdover/BladeSet/BladeSetServiceProvider.php +++ b/src/Alexdover/BladeSet/BladeSetServiceProvider.php @@ -22,7 +22,7 @@ class BladeSetServiceProvider extends ServiceProvider { $blade->extend( function($value, $compiler) { - $value = preg_replace("/@set\('(.*)'\,(.*)\)/", '<?php $$1 = $2; ?>', $value); + $value = preg_replace("/@set\('(.*?)'\,(.*)\)/", '<?php $$1 = $2; ?>', $value); return $value; });
A slightly improved regex to prevent quoted values being picked up.
alexdover_blade-set
train
php
34318874c2c7c6c2c27829f2e9a5771fb158b7f5
diff --git a/race.py b/race.py index <HASH>..<HASH> 100644 --- a/race.py +++ b/race.py @@ -120,7 +120,7 @@ def subverting_aries_fix(): # Store an original version of the entity # NOTE: Do not wish to store this one value in memcache, turning it off ent1.put(use_memcache=False) - + a_written_to_datastore = False a_lock1 = threading.Lock() @@ -145,7 +145,7 @@ def subverting_aries_fix(): a_lock3.acquire() fut.check_success() a_lock3.release() - + class C(threading.Thread): def run(self): ctx = setup_context() @@ -186,16 +186,16 @@ def subverting_aries_fix(): logging.info('B: write to memcache (writes a stale value)') b.get_result() eventloop.run() # Puts to memcache are still stuck in the eventloop - + logging.info('C: read from memcache (sees a stale value)') c = C() c.start() c.join() - + logging.info('A: delete from memcache (deletes the stale value!)') a_lock3.release() a.join() - + pb3 = memcache.get(keystr) assert pb3 is not context._LOCKED, 'Received _LOCKED value' if pb3 is not None:
Remove trailing spaces from race.py.
GoogleCloudPlatform_datastore-ndb-python
train
py
d975506f8684a47b86891af1094edc71287ac781
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -68,8 +68,8 @@ function serialize(form, options) { val = []; var options = element.options; - for (var i=0 ; i<options.length ; ++i) { - var option = options[i]; + for (var j=0 ; j<options.length ; ++j) { + var option = options[j]; if (option.selected) { result = serializer(result, key, option.value); }
Use new var 'j' in inner for-loop. Previously used 'i' which conflicted with outer for-loop.
defunctzombie_form-serialize
train
js
d4f00696199450eca94d442cddd28a0f52251e6f
diff --git a/crudbuilder/abstract.py b/crudbuilder/abstract.py index <HASH>..<HASH> 100644 --- a/crudbuilder/abstract.py +++ b/crudbuilder/abstract.py @@ -32,6 +32,7 @@ class BaseBuilder(object): self.custom_update_view_mixin = self._has_crud_attr('custom_update_view_mixin') self.custom_create_view_mixin = self._has_crud_attr('custom_create_view_mixin') + self.custom_delete_view_mixin = self._has_crud_attr('custom_delete_view_mixin') # django tables2 self.custom_table2 = self._has_crud_attr('custom_table2') diff --git a/crudbuilder/views.py b/crudbuilder/views.py index <HASH>..<HASH> 100644 --- a/crudbuilder/views.py +++ b/crudbuilder/views.py @@ -202,7 +202,15 @@ class ViewBuilder(BaseBuilder): custom_postfix_url=self.custom_postfix_url ) - delete_class = type(name, (CrudBuilderMixin, DeleteView), delete_args) + parent_classes = [CrudBuilderMixin, DeleteView] + if self.custom_delete_view_mixin: + parent_classes.insert(0, self.custom_delete_view_mixin) + + delete_class = type( + name, + tuple(parent_classes), + delete_args + ) self.classes[name] = delete_class return delete_class
added custom delete mixin attr
asifpy_django-crudbuilder
train
py,py
fde9bab3348149d08614f5b86c46f4fe14a34149
diff --git a/pianoroll/track.py b/pianoroll/track.py index <HASH>..<HASH> 100644 --- a/pianoroll/track.py +++ b/pianoroll/track.py @@ -160,13 +160,13 @@ class Track(object): self.lowest_pitch = lowest - pitch_range = highest - lowest + 1 - if self.pianoroll.shape[1] < pitch_range: - to_pad = pitch_range - self.pianoroll.shape[1] + pitch_axis_length = highest - lowest + 1 + if self.pianoroll.shape[1] < pitch_axis_length: + to_pad = pitch_axis_length - self.pianoroll.shape[1] self.pianoroll = np.pad(self.pianoroll, ((0, 0), (0, to_pad)), 'constant') - elif self.pianoroll.shape[1] > pitch_range: - self.pianoroll = self.pianoroll[:, :pitch_range] + elif self.pianoroll.shape[1] > pitch_axis_length: + self.pianoroll = self.pianoroll[:, :pitch_axis_length] def get_pianoroll(self): """
Change double backquotes to single backquote
salu133445_pypianoroll
train
py
2f61da4e713173f954bd58504e898ad202d4ffe2
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -111,6 +111,7 @@ class Puppet::Configurer def prepare_and_retrieve_catalog(options, query_options) # set report host name now that we have the fact options[:report].host = Puppet[:node_name_value] + query_options[:transaction_uuid] = @transaction_uuid unless catalog = (options.delete(:catalog) || retrieve_catalog(query_options)) Puppet.err "Could not retrieve catalog; skipping run" @@ -211,7 +212,6 @@ class Puppet::Configurer Puppet.push_context({:current_environment => local_node_environment}, "Local node environment for configurer transaction") query_options = get_facts(options) unless query_options - query_options[:transaction_uuid] = @transaction_uuid query_options[:configured_environment] = configured_environment unless catalog = prepare_and_retrieve_catalog(options, query_options) @@ -232,7 +232,6 @@ class Puppet::Configurer report.environment = @environment query_options = get_facts(options) - query_options[:transaction_uuid] = @transaction_uuid query_options[:configured_environment] = configured_environment return nil unless catalog = prepare_and_retrieve_catalog(options, query_options)
(maint) Refactor preparing a catalog request The transaction_uuid is a property of the Configurer class. We know we put it in the catalog request the same way every time, so move adding it to the helper generating the catalog request, rather than doing it externally twice.
puppetlabs_puppet
train
rb
2b30dcdc03fcbfa6a3b0e92233cfae601f105366
diff --git a/views/messages.js b/views/messages.js index <HASH>..<HASH> 100644 --- a/views/messages.js +++ b/views/messages.js @@ -41,6 +41,16 @@ module.exports = function (lvl) { }, api: { + /** + * Creates a read stream of messages + * @param {Object} core - HyperCore to stream messages from. + * @param {String} channel - Name of channel + * @param {Object} opts : + * `gt` {Number} - Filter by timestamp where message.timestamp is greater than `gt` + * `lt` {Number} - Filter by timestamp where message.timestamp is lesser than `lt` + * Supports all levelup.createValueStream() options as well: + * `reverse` {Boolean} - Streams messages in Ascending time order, default: `true` (Descending) + */ read: function (core, channel, opts) { opts = opts || {} @@ -52,9 +62,7 @@ module.exports = function (lvl) { else opts.lt = 'msg!' + channel + '~' this.ready(function () { - var v = lvl.createValueStream(xtend(opts, { - reverse: true - })) + var v = lvl.createValueStream(xtend({reverse: true}, opts)) v.pipe(t) })
Allow messages.read() opts to take priority over defaults Changed the order of the `xtend()` assignment, so that passed opts takes priority making it possible to override the `{reverse: true}` with a `false` value instead. Also added some semi-accurate documentation to that method based on assumptions.
cabal-club_cabal-core
train
js
82765082329ad3b4220bccd5fd8e22722856d760
diff --git a/src/util/layout.js b/src/util/layout.js index <HASH>..<HASH> 100644 --- a/src/util/layout.js +++ b/src/util/layout.js @@ -36,7 +36,7 @@ define(function(require) { x = 0; nextX = moveX; y += currentLineMaxSize + gap; - currentLineMaxSize = 0; + currentLineMaxSize = rect.height; } else { currentLineMaxSize = Math.max(currentLineMaxSize, rect.height); @@ -50,7 +50,7 @@ define(function(require) { x += currentLineMaxSize + gap; y = 0; nextY = moveY; - currentLineMaxSize = 0; + currentLineMaxSize = rect.width; } else { currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);
Legend layout fix in too small width case
apache_incubator-echarts
train
js
c504553880bb47924e673bafbb002c0ec5f6c921
diff --git a/master/buildbot/status/web/status_json.py b/master/buildbot/status/web/status_json.py index <HASH>..<HASH> 100644 --- a/master/buildbot/status/web/status_json.py +++ b/master/buildbot/status/web/status_json.py @@ -23,7 +23,7 @@ import re from twisted.internet import defer from twisted.web import html, resource, server -from buildbot.status.web.base import HtmlResource +from buildbot.status.web.base import HtmlResource, path_to_root from buildbot.util import json @@ -344,7 +344,7 @@ class HelpResource(HtmlResource): cxt['flags'] = ToHtml(FLAGS) cxt['examples'] = ToHtml(EXAMPLES).replace( 'href="/json', - 'href="../%sjson' % (self.parent_level * '../')) + 'href="%s' % path_to_root(request) + 'json') template = request.site.buildbot_service.templates.get_template("jsonhelp.html") return template.render(**cxt)
json: proper path root in examples this is needed when you map the buildbot instance for example to <URL>
buildbot_buildbot
train
py
3f0ce03939620fc03e1500897f7a8970a2f1da48
diff --git a/protocol/vm/introspection.go b/protocol/vm/introspection.go index <HASH>..<HASH> 100644 --- a/protocol/vm/introspection.go +++ b/protocol/vm/introspection.go @@ -2,10 +2,11 @@ package vm import ( "bytes" - - "chain/protocol/bc" + "math" "golang.org/x/crypto/sha3" + + "chain/protocol/bc" ) func opFindOutput(vm *virtualMachine) error { @@ -142,7 +143,12 @@ func opMaxTime(vm *virtualMachine) error { return err } - return vm.pushInt64(int64(vm.tx.MaxTime), true) + maxTime := vm.tx.MaxTime + if maxTime == 0 || maxTime > math.MaxInt64 { + maxTime = uint64(math.MaxInt64) + } + + return vm.pushInt64(int64(maxTime), true) } func opRefDataHash(vm *virtualMachine) error {
protocol/vm: Fix a bug in opMaxTime Was failing to interpret a maxtime of 0 as "unlimited." Closes chain/chainprv#<I>. Reviewers: @kr
chain_chain
train
go
4bbe5c99699cfa93041cd05034c5e9c80141e606
diff --git a/src/plugins/Slider.js b/src/plugins/Slider.js index <HASH>..<HASH> 100644 --- a/src/plugins/Slider.js +++ b/src/plugins/Slider.js @@ -294,10 +294,12 @@ export class Slider { y: touch.pageY }); - event.stopPropagation(); + // event.stopPropagation(); } touchmove(event) { + if (!this.touchOrig) return; + let touch = event.touches[0]; this.dragMove({ @@ -305,12 +307,13 @@ export class Slider { y: touch.pageY }); - event.stopPropagation(); + // event.stopPropagation(); } touchend(event) { this.dragEnd(); - event.stopPropagation(); + + // event.stopPropagation(); } mousestart(event) { @@ -319,7 +322,7 @@ export class Slider { y: event.pageY }); - event.preventDefault(); + // event.preventDefault(); } mousemove(event) { @@ -330,12 +333,12 @@ export class Slider { y: event.pageY }); - event.preventDefault(); + // event.preventDefault(); } mouseend(event) { this.dragEnd(); - event.preventDefault(); + // event.preventDefault(); } dragStart(position) {
test - remove event blocking from slider
chirashijs_chirashi
train
js
400de984cf7264edc58b77a7e1dc55a0a9f34556
diff --git a/Eloquent/Collection.php b/Eloquent/Collection.php index <HASH>..<HASH> 100755 --- a/Eloquent/Collection.php +++ b/Eloquent/Collection.php @@ -208,6 +208,21 @@ class Collection extends BaseCollection } /** + * Make the given, typically hidden, attributes visible across the entire collection. + * + * @param array|string $attributes + * @return $this + */ + public function withHidden($attributes) + { + $this->each(function ($model) use ($attributes) { + $model->withHidden($attributes); + }); + + return $this; + } + + /** * Get a dictionary keyed by primary keys. * * @param \ArrayAccess|array $items
add withHidden to eloquent collection to quickly manipulate entire collection
illuminate_database
train
php
cee7af9f11e1f76645ef462d47fa8f48a40f4a64
diff --git a/packages/webdev-setup-tools/lib/setup.js b/packages/webdev-setup-tools/lib/setup.js index <HASH>..<HASH> 100644 --- a/packages/webdev-setup-tools/lib/setup.js +++ b/packages/webdev-setup-tools/lib/setup.js @@ -18,7 +18,7 @@ const options = { resolve(data); }, stdout: data => { - console.log(data); + process.stdout.write(data); } }; let findRequiredAndOptionalUpdates = (userGlobals, projectGlobals, highestVersion) => {
reformat code in setup.js
tmo-ng_webdev-setup-tools-plugins
train
js
a410a2f01fedea39f2bb33543d8fcbd65cedb75b
diff --git a/benchmarks/memory.rb b/benchmarks/memory.rb index <HASH>..<HASH> 100755 --- a/benchmarks/memory.rb +++ b/benchmarks/memory.rb @@ -6,6 +6,8 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'backports' + unless GC.respond_to?(:enable_stats) puts 'Error: benchmark works on ree, or ruby with Railsbench GC patch only' exit 1 diff --git a/benchmarks/speed.rb b/benchmarks/speed.rb index <HASH>..<HASH> 100755 --- a/benchmarks/speed.rb +++ b/benchmarks/speed.rb @@ -6,6 +6,7 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'backports' require 'rbench' require 'veritas' include Veritas
Update benchmarking scripts to use backports to work with <I>
dkubb_axiom
train
rb,rb
635751d809af309c7c36c0c9d7a94a731ef8bd1c
diff --git a/lib/puppet/interface/certificate.rb b/lib/puppet/interface/certificate.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/interface/certificate.rb +++ b/lib/puppet/interface/certificate.rb @@ -13,10 +13,9 @@ Puppet::Interface::Indirector.interface(:certificate) do action :list do invoke do - Puppet::SSL::Host.indirection.search("*").each do |host| - puts host.inspect - end - nil + Puppet::SSL::Host.indirection.search("*", { + :for => :certificate_request, + }).map { |h| h.inspect } end end
Propagating an argument to search out of core. Puppet::SSL::Host.search (which will proxy to the new indirection) accepts an array of classes (now also class names) to limit the search. Currently, `puppet certificate list` limits itself to certificate requests to mimic the behavior of `puppet cert -l`.
puppetlabs_puppet
train
rb
3b3972f99c568d488974e62955f6ebf9d7d81251
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ setup( author='Sriram Panyam', author_email='sri.panyam@gmail.com', description=("Utilities and library to model types and type systems"), + zip_safe = False, license='BSD', packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES), include_package_data=True,
Making sources unzipped to ease debugging
panyam_typecube
train
py
e243e7e1010086f7cf4ae421f30a9c75c2bde635
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -512,6 +512,8 @@ Pagelet.optimize = function optimize(hook) { Pagelet.freelist.free(pagelet); pagelet = null; }); + + return pagelet; }); return Pagelet;
[fix] Actually return the pagelet, or it will not work.
bigpipe_pagelet
train
js
1f3d836c4d470f60563768451d0cdf7a5b63193d
diff --git a/library/CM/FormField/Location.php b/library/CM/FormField/Location.php index <HASH>..<HASH> 100755 --- a/library/CM/FormField/Location.php +++ b/library/CM/FormField/Location.php @@ -53,8 +53,14 @@ class CM_FormField_Location extends CM_FormField_SuggestOne { return; } - $level = $requestLocation->getLevel(); - if ($level >= $this->_options['levelMin'] && $level <= $this->_options['levelMax']) { + if ($requestLocation->getLevel() > $this->_options['levelMax']) { + $requestLocation = $requestLocation->get($this->_options['levelMax']); + if (null === $requestLocation) { + return; + } + } + + if ($requestLocation->getLevel() >= $this->_options['levelMin']) { $this->setValue($requestLocation); } }
Try to get a new location if the level is too high
cargomedia_cm
train
php
3145036b055b569f77b3ef278f0f59619aa7f9dc
diff --git a/javamelody-core/src/main/java/net/bull/javamelody/JdbcWrapper.java b/javamelody-core/src/main/java/net/bull/javamelody/JdbcWrapper.java index <HASH>..<HASH> 100644 --- a/javamelody-core/src/main/java/net/bull/javamelody/JdbcWrapper.java +++ b/javamelody-core/src/main/java/net/bull/javamelody/JdbcWrapper.java @@ -309,7 +309,8 @@ public final class JdbcWrapper { final String serverInfo = servletContext.getServerInfo(); jboss = serverInfo.contains("JBoss") || serverInfo.contains("WildFly"); glassfish = serverInfo.contains("GlassFish") - || serverInfo.contains("Sun Java System Application Server"); + || serverInfo.contains("Sun Java System Application Server") + || serverInfo.contains("Payara"); weblogic = serverInfo.contains("WebLogic"); jonas = System.getProperty("jonas.name") != null; connectionInformationsEnabled = Parameters.isSystemActionsEnabled()
Resolves Issue #<I>
javamelody_javamelody
train
java
fbb45c5725277130806ecb44d5f2489410d93de7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='soundscrape', - version='0.26.1', + version='0.26.2', packages=['soundscrape'], install_requires=required, extras_require={ ':python_version < "3.0"': [ 'wsgiref>=0.1.2', ], },
<I> - fix folders on scraped tracks
Miserlou_SoundScrape
train
py
1bcd77828d2390d252e646dd271e4b1412b2a0d6
diff --git a/src/crosstab.js b/src/crosstab.js index <HASH>..<HASH> 100644 --- a/src/crosstab.js +++ b/src/crosstab.js @@ -151,6 +151,7 @@ util.eventTypes = { becomeMaster: 'becomeMaster', + demoteFromMaster: 'demotedFromMaster', tabUpdated: 'tabUpdated', tabClosed: 'tabClosed', tabPromoted: 'tabPromoted' @@ -476,17 +477,23 @@ eventHandler.addListener(util.eventTypes.tabPromoted, function (message) { var id = message.data; var lastUpdated = message.timestamp; + var previousMaster = getMaster().id; setMaster({ id: id, lastUpdated: lastUpdated }); - if (crosstab.id === id) { + if (crosstab.id === id + && previousMaster !== crosstab.id) { // set the tabs in localStorage setStoredTabs(); // emit the become master event so we can handle it accordingly util.events.emit(util.eventTypes.becomeMaster); + } else if (crosstab.id !== id + && previousMaster === crosstab.id) { + // emit the demoted from master event so we can clean up resources + util.events.emit(util.eventTypes.demoteFromMaster); } });
Add demotedFromMaster event emission when a tab loses master status
tejacques_crosstab
train
js
32f8bca12797a0fe67186211ee433f3dccba1e50
diff --git a/setuptools_scm/version.py b/setuptools_scm/version.py index <HASH>..<HASH> 100644 --- a/setuptools_scm/version.py +++ b/setuptools_scm/version.py @@ -22,8 +22,8 @@ def _warn_if_setuptools_outdated(): def callable_or_entrypoint(group, callable_or_name): trace('ep', (group, callable_or_name)) if isinstance(callable_or_name, str): - ep = next(iter_entry_points(group, callable_or_name)) - return ep.load() + for ep in iter_entry_points(group, callable_or_name): + return ep.load() else: return callable_or_name
simplify callable_or_entrypoint(group, callable_or_name)
pypa_setuptools_scm
train
py
fde0179dd762a4fcd8c997703efaed8f0744c00d
diff --git a/src/kff.Dispatcher.js b/src/kff.Dispatcher.js index <HASH>..<HASH> 100644 --- a/src/kff.Dispatcher.js +++ b/src/kff.Dispatcher.js @@ -43,17 +43,8 @@ kff.Dispatcher = kff.createClass({ { for(var action in actions) { - if(!(actions[action] instanceof Array)) callbacks = [actions[action]]; - else callbacks = actions[action]; - - if(!(action in this.actions)) this.actions[action] = []; - - this.actions[action] = this.actions[action].concat(callbacks); - - for(var i = 0; i < callbacks.length; i++) - { - this.on(action, this.createCallback(callbacks[i])); - } + this.actions[action] = actions[action]; + this.on(action, this.createCallback(actions[action])); } } },
refactor(kff.Dispatcher): every action should have only one callback
karfcz_kff
train
js
932878e1f12b2518f30dda2d441668362237b106
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -101,7 +101,7 @@ func (c *Client) ReadResponse() (*Response, error) { // message binary data buf := make([]byte, msgSize-4) - _, err = c.conn.Read(buf) + _, err = io.ReadFull(c.conn, buf) if err != nil { return nil, err }
use ReadFull() where appropriate
nsqio_go-nsq
train
go
f7fb33ed8e8edb1a6d01f9a39fabf29e2df10788
diff --git a/src/core/components/bootstrap.js b/src/core/components/bootstrap.js index <HASH>..<HASH> 100644 --- a/src/core/components/bootstrap.js +++ b/src/core/components/bootstrap.js @@ -20,10 +20,10 @@ module.exports = function bootstrap (self) { args = {default: false} } try { - if (multiaddr) - new MultiAddr(multiaddr) - } - catch (err) { + if (multiaddr) { + multiaddr = new MultiAddr(multiaddr) + } + } catch (err) { return setImmediate(() => callback(err)) } self._repo.config.get((err, config) => { @@ -52,12 +52,13 @@ module.exports = function bootstrap (self) { args = {all: false} } try { - if (multiaddr) - new MultiAddr(multiaddr) - } - catch (err) { + if (multiaddr) { + multiaddr = new MultiAddr(multiaddr) + } + } catch (err) { return setImmediate(() => callback(err)) } + self._repo.config.get((err, config) => { if (err) { return callback(err)
refactor: fix linting from bootstrap.js
ipfs_js-ipfs
train
js
40e6d8997bb7695934b9db9865ddc70d437b4a14
diff --git a/elasticsearch-api/spec/elasticsearch/api/utils_spec.rb b/elasticsearch-api/spec/elasticsearch/api/utils_spec.rb index <HASH>..<HASH> 100644 --- a/elasticsearch-api/spec/elasticsearch/api/utils_spec.rb +++ b/elasticsearch-api/spec/elasticsearch/api/utils_spec.rb @@ -27,7 +27,7 @@ describe Elasticsearch::API::Utils do expect(utils.__escape('foo bar')).to eq('foo+bar') end - it 'uses the escape_utils gem when available' do + it 'uses the escape_utils gem when available', unless: JRUBY do require 'escape_utils' expect(CGI).not_to receive(:escape) expect(EscapeUtils).to receive(:escape_url).and_call_original
[API] Account for escape_utils not being available for JRuby
elastic_elasticsearch-ruby
train
rb
2a51adc8bb2a8dd25c336d8c6b194ddac2b4906e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -80,7 +80,7 @@ function setTimeZone(timezone) { } this.toDateString = function toDateString() { - return exports.DAYS_OF_WEEK[this.getDay()].substring(0, 3) + ' ' + exports.MONTHS[this.getMonth()].substring(0, 3) + ' ' + this.getDate() + ' ' + this.getFullYear(); + return exports.DAYS_OF_WEEK[this.getDay()].substring(0, 3) + ' ' + exports.MONTHS[this.getMonth()].substring(0, 3) + ' ' + pad(this.getDate(), 2) + ' ' + this.getFullYear(); } this.toTimeString = function toTimeString() { @@ -94,7 +94,7 @@ function setTimeZone(timezone) { } this.toLocaleDateString = function toLocaleDateString() { - return exports.DAYS_OF_WEEK[this.getDay()] + ', ' + exports.MONTHS[this.getMonth()] + ' ' + this.getDate() + ', ' + this.getFullYear(); + return exports.DAYS_OF_WEEK[this.getDay()] + ', ' + exports.MONTHS[this.getMonth()] + ' ' + pad(this.getDate(), 2) + ', ' + this.getFullYear(); } this.toLocaleTimeString = function toLocaleTimeString() {
Pad the day when 'toString'ing as well
TooTallNate_node-time
train
js
bf83b4cf24ba6f8415771af68f459b8db92a2c43
diff --git a/client/libquassel.js b/client/libquassel.js index <HASH>..<HASH> 100644 --- a/client/libquassel.js +++ b/client/libquassel.js @@ -17221,7 +17221,8 @@ var IRCBuffer = function IRCBuffer(id, data) { this.id = id; this.nickUserMap = {}; this.nickUserModesMap = {}; - this.messages = new Map; + //this.messages = new Map; + this.messages = new HashMap(); this.active = false; this._isStatusBuffer = false; this.order = null;
rollback Map implementation for now, needs a lot more testing
magne4000_node-libquassel
train
js
deec8a213bece4458fcec1e1ede1e5ccc3c2238f
diff --git a/spec/progress_spec.rb b/spec/progress_spec.rb index <HASH>..<HASH> 100644 --- a/spec/progress_spec.rb +++ b/spec/progress_spec.rb @@ -148,8 +148,21 @@ describe Progress do expect(enum.with_progress.each{}).to eq(enum) end - it "yields same objects for #{enum.class}" do - expect(enum.with_progress.entries).to eq(enum.entries) + context 'yielding' do + let(:expected){ [] } + let(:got){ [] } + + after{ expect(got).to eq(expected) } + + it "yields same objects with one block argument for #{enum.class}" do + enum.each{ |a| expected << a } + enum.with_progress{ |a| got << a } + end + + it "yields same objects with two block arguments for #{enum.class}" do + enum.each{ |a, b| expected << [a, b] } + enum.with_progress{ |a, b| got << [a, b] } + end end end
proper test for yielding objects for Array, Hash and Set
toy_progress
train
rb
6a3e0cceb5fee0c8c4ff42df7c431063753df2de
diff --git a/pymc/tests/test_glm.py b/pymc/tests/test_glm.py index <HASH>..<HASH> 100644 --- a/pymc/tests/test_glm.py +++ b/pymc/tests/test_glm.py @@ -1,4 +1,5 @@ import unittest +from nose import SkipTest from pymc import * import sys @@ -31,6 +32,7 @@ bern_trials = [np.random.binomial(1, i) for i in y_logistic] data_logistic = dict(x=x_logistic, y=bern_trials) class TestGLM(unittest.TestCase): + @SkipTest("Fails only on travis. Investigate") def test_linear_component(self): with Model() as model: y_est, coeffs = glm.linear_component('y ~ x', data_linear) @@ -46,6 +48,7 @@ class TestGLM(unittest.TestCase): self.assertAlmostEqual(np.mean(trace.samples['x'].value), true_slope, 1) self.assertAlmostEqual(np.mean(trace.samples['sigma'].value), true_sd, 1) + @SkipTest("Fails only on travis. Investigate") def test_glm(self): with Model() as model: vars = glm.glm('y ~ x', data_linear)
Skip glm tests that are only failing on travis.
pymc-devs_pymc
train
py
6acc8e3155c8b3c13c695a26b218e282fa873b33
diff --git a/src/lookup-priorities.js b/src/lookup-priorities.js index <HASH>..<HASH> 100644 --- a/src/lookup-priorities.js +++ b/src/lookup-priorities.js @@ -1,16 +1,23 @@ -// order for what should take precendence when looking up // a helper or function in the scope // (local helpers most important, then built in helpers, etc) -var priorities = [ - "LOCAL_HELPER", - "BUILT_IN_HELPER",// #each helper - "SCOPE_FUNCTION",// DefineMap.prototype.each - "SCOPE_PROPERTY", - "GLOBAL_HELPER", - "MAX" -].reduce(function(priorities, key, index) { - priorities[key] = index + 1; - return priorities; -}, {}); +var priorities = { + // helpers in the templateContext + LOCAL_HELPER: 1, + + // built-in helpers like #each + BUILT_IN_HELPER: 2, + + // properties like DefineMap.prototype.each + SCOPE_FUNCTION: 3, + + // properties on the scope object (that are not functions) + SCOPE_PROPERTY: 4, + + // gloabl helpers registered by the user + GLOBAL_HELPER: 5, + + // default priority + MAX: 6 +}; module.exports = priorities;
simplifying lookup-priorities now that it is working
canjs_can-stache
train
js
f017d218504465eb1bb08d6456c3327f872b51ac
diff --git a/autoinput.js b/autoinput.js index <HASH>..<HASH> 100644 --- a/autoinput.js +++ b/autoinput.js @@ -16,14 +16,12 @@ defineOption("autoInput", false, function(pm, val) { if (val) { pm.mod.autoInput = [] pm.schema.registry("autoInput", (rule, type, name) => { - let rname = "schema:" + name + ":" + rule.name, handler = rule.handler - if (pm.isIncluded(rname)) { - if (handler.bind) handler = handler.bind(type) - addInputRule(pm, new InputRule(rname, rule.match, rule.filter, handler)) - pm.mod.autoInput.push(rname) - } + let rname = name + ":" + rule.name, handler = rule.handler + if (handler.bind) handler = handler.bind(type) + addInputRule(pm, new InputRule(rname, rule.match, rule.filter, handler)) + pm.mod.autoInput.push(rname) }) - for (let name in rules) if (pm.isIncluded(name)) { + for (let name in rules) { let rule = rules[name] addInputRule(pm, rule) pm.mod.autoInput.push(rule.name)
Drop include option / namespaces Too indirect and kludgy
ProseMirror_prosemirror-inputrules
train
js
1e7b428d16cbe85e042a0d88e13d5a0d187b8ffa
diff --git a/src/wyc/stages/CodeGeneration.java b/src/wyc/stages/CodeGeneration.java index <HASH>..<HASH> 100644 --- a/src/wyc/stages/CodeGeneration.java +++ b/src/wyc/stages/CodeGeneration.java @@ -308,7 +308,7 @@ public final class CodeGeneration { if(s.lhs instanceof Expr.LocalVariable) { blk = generate(s.rhs, environment); Expr.LocalVariable v = (Expr.LocalVariable) s.lhs; - blk.append(Code.Store(null, allocate(v.var, environment)), + blk.append(Code.Store(v.rawType(), allocate(v.var, environment)), attributes(s)); } else if(s.lhs instanceof Expr.Tuple) { Expr.Tuple tg = (Expr.Tuple) s.lhs;
Finally some, but not many, unit tests are passing.
Whiley_WhileyCompiler
train
java
3b3f3665d3dcae0319bca4c4c80d693f31bdf9a9
diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index <HASH>..<HASH> 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -7,6 +7,7 @@ package bootstrap import ( "fmt" + "go/format" "io/ioutil" "os" "os/exec" @@ -176,18 +177,21 @@ func (g *Generator) Run() error { if err = cmd.Run(); err != nil { return err } - f.Close() - if !g.NoFormat { - cmd = exec.Command("gofmt", "-w", f.Name()) - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - - if err = cmd.Run(); err != nil { - return err - } + // move unformatted file to out path + if g.NoFormat { + return os.Rename(f.Name(), g.OutName) } - return os.Rename(f.Name(), g.OutName) + // format file and write to out path + in, err := ioutil.ReadFile(f.Name()) + if err != nil { + return err + } + out, err := format.Source(in) + if err != nil { + return err + } + return ioutil.WriteFile(g.OutName, out, 0644) }
Convert exec.Command for gofmt to standard go/format package Converts exec.Command call for formatting the generated Go code from the bootstrapper to use the standard `go/format` package for formatting. Fixes an issue / problem that the `cdproto-gen` tool is encountering.
mailru_easyjson
train
go
4e12d5e7da7a0b551eb9091bb5f54de67509e220
diff --git a/test/functional/PlaceholderTemplateTest.php b/test/functional/PlaceholderTemplateTest.php index <HASH>..<HASH> 100644 --- a/test/functional/PlaceholderTemplateTest.php +++ b/test/functional/PlaceholderTemplateTest.php @@ -165,11 +165,11 @@ class PlaceholderTemplateTest extends TestCase } /** - * Tests whether `_render()` works as expected when given a context. + * Tests whether `render()` works as expected when given a context. * * @since [*next-version*] */ - public function testProtectedRenderContext() + public function testRenderContext() { $template = 'The quick brown ${fox} jumped over the lazy ${dog}; what a ${rascal} that ${adjective} ${fox}!'; $tStart = '${';
Corrected test name and docs
Dhii_placeholder-template
train
php
2603a3e6f24856ed74163ee6e9f985f90434b9fa
diff --git a/molo/core/models.py b/molo/core/models.py index <HASH>..<HASH> 100644 --- a/molo/core/models.py +++ b/molo/core/models.py @@ -182,6 +182,9 @@ class ArticlePage(Page): FieldPanel('featured_in_homepage'), ] + def get_absolute_url(self): + return self.url + def get_parent_section(self): return SectionPage.objects.all().ancestor_of(self).last()
add get_absolute_url to ArticlePage to make comments framework redirects happier
praekeltfoundation_molo
train
py
f2f317dc4dc46c6b2543773d0699ecfd1d4a31b6
diff --git a/python/dllib/src/test/bigdl/utils/test_utils.py b/python/dllib/src/test/bigdl/utils/test_utils.py index <HASH>..<HASH> 100644 --- a/python/dllib/src/test/bigdl/utils/test_utils.py +++ b/python/dllib/src/test/bigdl/utils/test_utils.py @@ -21,8 +21,6 @@ import shutil from unittest import TestCase import keras.backend as K -import numpy as np -from bigdl.keras.converter import WeightLoader from zoo.common.nncontext import * @@ -125,6 +123,7 @@ class ZooTestCase(TestCase): """ Compare forward results for Keras model against Zoo Keras API model. """ + from bigdl.keras.converter import WeightLoader WeightLoader.load_weights_from_kmodel(zmodel, kmodel) zmodel.training(is_training=False) bigdl_output = zmodel.forward(input_data)
Support trainable variable (#<I>) * www * fix concrete * revert
intel-analytics_BigDL
train
py
d6da64959b63f4d3429c8433fd0717d56954e789
diff --git a/spec/snippetPreviewSpec.js b/spec/snippetPreviewSpec.js index <HASH>..<HASH> 100644 --- a/spec/snippetPreviewSpec.js +++ b/spec/snippetPreviewSpec.js @@ -22,3 +22,31 @@ describe("The snippet preview constructor", function() { expect(snippetPreview.refObj).toBe(mockApp); }) }); + +describe( "The SnippetPreview format functions", function(){ + it( "formats texts to use in the SnippetPreview", function(){ + // Makes lodash think this is a valid HTML element + var mockElement = []; + mockElement.nodeType = 1; + + var mockApp = { + rawData: { + snippetTitle: "<span>snippetTitle</span>", + snippetCite: "", + snippetMeta: "", + keyword: "keyword" + }, + pluggable: { + loaded: true, + _applyModifications: function(name, text){return text} + } + }; + + var snippetPreview = new SnippetPreview({ + analyzerApp: mockApp, + targetElement: mockElement + }); + + expect( snippetPreview.formatTitle() ).toBe( "snippetTitle" ); + }); +} );
Adds spec to check if modules are working
Yoast_YoastSEO.js
train
js
cd297dd9ebb7559fc6f0d7ca43bc13dc07e36b9e
diff --git a/jquery/jquery.js b/jquery/jquery.js index <HASH>..<HASH> 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -106,7 +106,9 @@ function $(a,c) { }, removeClass: function(c) { return this.each(function(){ - this.className = c == null ? '' : + if ( c == null ) + this.className = ''; + else this.className.replace( new RegExp('(^|\\s*\\b[^-])'+c+'($|\\b(?=[^-]))', 'g'), ''); });
Extra spaces weren't being removed with removeClass - but I haven't found a good workaround yet.
jquery_jquery
train
js
e3c41f81390284a0bae1a8859d7f8937dbd86304
diff --git a/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/context/selectitem/DistinctSelectItem.java b/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/context/selectitem/DistinctSelectItem.java index <HASH>..<HASH> 100644 --- a/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/context/selectitem/DistinctSelectItem.java +++ b/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/context/selectitem/DistinctSelectItem.java @@ -27,12 +27,13 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; +import java.util.regex.Pattern; + /** * Distinct select item. * * @author panjuan */ -@RequiredArgsConstructor @Getter @EqualsAndHashCode @ToString @@ -45,12 +46,6 @@ public final class DistinctSelectItem implements SelectItem { @Setter private int index = -1; - public DistinctSelectItem(final String innerExpression, final Optional<String> alias) { - - } - - - @Override public String getExpression() { return Strings.isNullOrEmpty(distinctColumn) ? DefaultKeyword.DISTINCT.name() : SQLUtil.getExactlyValue(DefaultKeyword.DISTINCT + " " + distinctColumn);
delete DistinctSelectItem()
apache_incubator-shardingsphere
train
java
3cab47ebe8a70f5fa3df0f83619830a5c2de45eb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,5 @@ setup( 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Text Processing :: Markup', ], )
fix: 'Topic :: Text Processing :: Markup' seems not supported
tanbro_pyyaml-include
train
py
6e6f0df2a03094ee715574283834d89ebb13ff4f
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1487,7 +1487,7 @@ const _startRenderLoop = () => { const _renderLoop = async () => { if (args.performance) { if (timestamps.frames >= TIMESTAMP_FRAMES) { - console.log(`${(TIMESTAMP_FRAMES/(timestamps.total/1000)).toFixed(0)} FPS | ${timestamps.idle}ms idle | ${timestamps.wait}ms wait | ${timestamps.prepare}ms prepare | ${timestamps.events}ms events | ${timestamps.media}ms media | ${timestamps.user}ms user | ${timestamps.submit}ms submit`); + console.log(`${(TIMESTAMP_FRAMES/(timestamps.total/1000)).toFixed(0)} FPS | ${timestamps.idle/timestamps.total}ms idle | ${timestamps.wait}ms wait | ${timestamps.prepare}ms prepare | ${timestamps.events}ms events | ${timestamps.media}ms media | ${timestamps.user}ms user | ${timestamps.submit}ms submit`); timestamps.frames = 0; timestamps.idle = 0;
divide by total timestamps timestamps idle
exokitxr_exokit
train
js
dbbb0fb35157b6f63cad130bac5bae3174a98d43
diff --git a/tests/Sabre/CalDAV/XMLUtilTest.php b/tests/Sabre/CalDAV/XMLUtilTest.php index <HASH>..<HASH> 100644 --- a/tests/Sabre/CalDAV/XMLUtilTest.php +++ b/tests/Sabre/CalDAV/XMLUtilTest.php @@ -282,6 +282,18 @@ XML; /** * @depends testParseICalendarDateTime */ + function testParseICalendarDateTimeUTC2() { + + $dateTime = Sabre_CalDAV_XMLUtil::parseICalendarDateTime('20101211T160000Z'); + + $compare = new DateTime('2010-12-11 16:00:00',new DateTimeZone('UTC')); + $this->assertEquals($compare, $dateTime); + + } + + /** + * @depends testParseICalendarDateTime + */ function testParseICalendarDateTimeCustomTimeZone() { $dateTime = Sabre_CalDAV_XMLUtil::parseICalendarDateTime('20100316T141405', new DateTimeZone('Europe/Amsterdam'));
Test for broken date. Updates Issue <I>.
sabre-io_dav
train
php
3e960567c769d7a90f83c5896dad8a279a2fcfed
diff --git a/main.js b/main.js index <HASH>..<HASH> 100644 --- a/main.js +++ b/main.js @@ -216,7 +216,8 @@ Object.defineProperties(Test.prototype,{ set: constants.NOOP }, wrap: {value: function(f){ - var self = this; + var self = this, + called = false; if(resolved.get(this)) throw new Error('Test already resolved, cannot call wrap again'); wraps.of(this).value++; @@ -224,6 +225,9 @@ Object.defineProperties(Test.prototype,{ return function(){ var ret; + if(called) throw new Error('A wrap can only be called once'); + called = true; + stack.push(self); try{ ret = f.apply(this,arguments); }
Wraps can now only be called once
manvalls_vz.test
train
js
53d083ec589ab395f5a519d0a28d840717062a5b
diff --git a/test/integration/base.py b/test/integration/base.py index <HASH>..<HASH> 100644 --- a/test/integration/base.py +++ b/test/integration/base.py @@ -451,6 +451,8 @@ class DBTIntegrationTest(unittest.TestCase): final_args.append('--strict') if parser: final_args.append('--test-new-parser') + if os.getenv('DBT_TEST_SINGLE_THREADED') in ('y', 'Y', '1'): + final_args.append('--single-threaded') final_args.extend(args) final_args.append('--log-cache-events')
fix this for real in a way that will make me not break it again
fishtown-analytics_dbt
train
py
3a0779e206811e87febfa0ac65fe5f3c2bd97a1f
diff --git a/content/template/detailTemplate/blocks/event-item.php b/content/template/detailTemplate/blocks/event-item.php index <HASH>..<HASH> 100644 --- a/content/template/detailTemplate/blocks/event-item.php +++ b/content/template/detailTemplate/blocks/event-item.php @@ -21,7 +21,7 @@ if ( ! empty( $ev['EventDates'] ) ) { <div data-groupid="eduev<?php echo( $group_by_city ? '-' . esc_attr( $ev['City'] ) : '' ); ?>" class="eventItem<?php echo( $show_more > 0 && $i >= $show_more ? ' showMoreHidden' : '' ); ?>"> <div class="eventDate<?php echo esc_attr( $group_by_city_class ); ?>"> - <?php echo edu_event_item_date( $ev, $event_dates ); ?> + <?php edu_event_item_date( $ev, $event_dates ); ?> </div> <?php if ( ! $group_by_city ) { ?> <div class="eventCity">
refactor: Doesn't need to be echoed.
MultinetInteractive_EduAdmin-WordPress
train
php
96f07283e702c943fd22f9338de2111618988ec9
diff --git a/src/main/java/org/bff/javampd/MPD.java b/src/main/java/org/bff/javampd/MPD.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/bff/javampd/MPD.java +++ b/src/main/java/org/bff/javampd/MPD.java @@ -36,24 +36,23 @@ import java.net.UnknownHostException; */ public class MPD implements Server { - private int port; - private InetAddress address; - private int timeout; - private static final int DEFAULT_PORT = 6600; private static final int DEFAULT_TIMEOUT = 0; private static final String DEFAULT_SERVER = "localhost"; - private ServerProperties serverProperties; - private CommandExecutor commandExecutor; - private Database database; - private Player player; - private Playlist playlist; - private Admin admin; - private ServerStatistics serverStatistics; - private ServerStatus serverStatus; - private StandAloneMonitor standAloneMonitor; - private EventRelayer eventRelayer; + private final int port; + private final InetAddress address; + private final int timeout; + private final ServerProperties serverProperties; + private final CommandExecutor commandExecutor; + private final Database database; + private final Player player; + private final Playlist playlist; + private final Admin admin; + private final ServerStatistics serverStatistics; + private final ServerStatus serverStatus; + private final StandAloneMonitor standAloneMonitor; + private final EventRelayer eventRelayer; private static final Logger LOGGER = LoggerFactory.getLogger(MPD.class);
Issue #<I> - finalize MPD immutable properties
finnyb_javampd
train
java
4ee584ee17ba69c1160ca80c556cf92bcd3feed3
diff --git a/lib/mrkt/faraday_middleware/response.rb b/lib/mrkt/faraday_middleware/response.rb index <HASH>..<HASH> 100644 --- a/lib/mrkt/faraday_middleware/response.rb +++ b/lib/mrkt/faraday_middleware/response.rb @@ -12,8 +12,8 @@ module Mrkt data = env[:body] - fail Mrkt::Errors::EmptyResponse if data.nil? - fail Mrkt::Errors::Error, data[:error_description] if data.key?(:error) + raise Mrkt::Errors::EmptyResponse if data.nil? + raise Mrkt::Errors::Error, data[:error_description] if data.key?(:error) handle_errors!(data[:errors]) unless data.fetch(:success, true) end @@ -21,8 +21,8 @@ module Mrkt def handle_errors!(errors) error = errors.first - fail Mrkt::Errors::Unknown if error.nil? - fail Mrkt::Errors.find_by_response_code(error[:code].to_i), error[:message] + raise Mrkt::Errors::Unknown if error.nil? + raise Mrkt::Errors.find_by_response_code(error[:code].to_i), error[:message] end end end
Use raise only instead of raise + fail
raszi_mrkt
train
rb
09896d4e6c8ddc2e5f8ca098f4530aea065ba7f7
diff --git a/safe/gui/widgets/dock.py b/safe/gui/widgets/dock.py index <HASH>..<HASH> 100644 --- a/safe/gui/widgets/dock.py +++ b/safe/gui/widgets/dock.py @@ -1177,9 +1177,9 @@ class Dock(QtGui.QDockWidget, FORM_CLASS): if self.zoom_to_impact_flag: self.iface.zoomToActiveLayer() + qgis_exposure = self.get_exposure_layer() if self.hide_exposure_flag: legend = self.iface.legendInterface() - qgis_exposure = self.get_exposure_layer() legend.setLayerVisible(qgis_exposure, False) if setting('generate_report', True, bool): @@ -1211,7 +1211,7 @@ class Dock(QtGui.QDockWidget, FORM_CLASS): self.extent.set_last_analysis_extent( self.impact_function.analysis_extent, - self.get_exposure_layer().crs()) + qgis_exposure.crs()) # We do not want to check the state of the next IF self.hide_busy(check_next_impact=False)
anticipate inactive exposure layer (#<I>)
inasafe_inasafe
train
py
2735535a222bbfa515c20e1da06e209a09a979b4
diff --git a/charm/repo_test.go b/charm/repo_test.go index <HASH>..<HASH> 100644 --- a/charm/repo_test.go +++ b/charm/repo_test.go @@ -28,12 +28,6 @@ var _ = gc.Suite(&StoreSuite{}) func (s *StoreSuite) SetUpSuite(c *gc.C) { s.LoggingSuite.SetUpSuite(c) - s.PatchEnvironment("http-proxy", "") - s.PatchEnvironment("HTTP-PROXY", "") - s.PatchEnvironment("http-proxys", "") - s.PatchEnvironment("HTTP-PROXYS", "") - s.PatchEnvironment("NO-PROXY", "") - s.PatchEnvironment("no-proxy", "") s.server = charmtesting.NewMockStore(c, map[string]int{ "cs:series/good": 23, "cs:series/unwise": 23,
Don't nuke proxy vars
juju_juju
train
go
f3973b6edbc90eb1592d28b98ca570aa89756582
diff --git a/lib/mac/bindings.js b/lib/mac/bindings.js index <HASH>..<HASH> 100644 --- a/lib/mac/bindings.js +++ b/lib/mac/bindings.js @@ -97,6 +97,12 @@ blenoBindings.startAdvertising = function(name, serviceUuids) { }; blenoBindings.startAdvertisingIBeacon = function(data) { + var osRelease = parseFloat(os.release()); + + if (osRelease >= 14) { + throw new Error('OS X 10.10 does not support advertising iBeacon'); + } + this.sendCBMsg(8, { kCBAdvDataAppleBeaconKey: data });
- OS X <I> does't support advertising iBeacon throw error as suggested by @line-o
noble_bleno
train
js
4b8e350a3664bbfa0563fef91fcbb0b96a998091
diff --git a/binstar_client/commands/upload.py b/binstar_client/commands/upload.py index <HASH>..<HASH> 100644 --- a/binstar_client/commands/upload.py +++ b/binstar_client/commands/upload.py @@ -190,8 +190,6 @@ def add_parser(subparsers): parser.add_argument('-d','--description', help='description of the file(s)') parser.add_argument('-m','--metadata', help='json encoded metadata default is to autodetect') group = parser.add_mutually_exclusive_group() - group.add_argument('-i', '--interactive', action='store_const', help='Run an interactive prompt if any packages are missing', - dest='mode', const='interactive') group.add_argument('-f', '--fail', help='Fail if a package or release does not exist (default)', action='store_const', dest='mode', const='fail' )
removed -i flag, always defaults
Anaconda-Platform_anaconda-client
train
py
af45834139b24a7d570c727cb1577152006378fa
diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/object/try.rb +++ b/activesupport/lib/active_support/core_ext/object/try.rb @@ -143,14 +143,14 @@ class NilClass # # With +try+ # @person.try(:children).try(:first).try(:name) - def try(method_name = nil, *args) + def try(_method_name = nil, *, **) nil end # Calling +try!+ on +nil+ always returns +nil+. # # nil.try!(:name) # => nil - def try!(method_name = nil, *args) + def try!(_method_name = nil, *, **) nil end end
nil.try accepts keyword arguments (and does nothing with them)
rails_rails
train
rb
a8dfb0ecd723f3995a3d16e4c3ed23c29d9f5ec7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ requires = ['numpy', 'scipy', 'matplotlib <= 1.5.3', 'biopython >= 1.60', scripts = ['bin/LDA.py', 'bin/LDA_bubble.py', 'bin/PCoA.py', - 'bin/PCoA_bubble.py' + 'bin/PCoA_bubble.py', 'bin/assign_taxonomy_by_blast_result.py', 'bin/barcode_filter.py', 'bin/biom_relative_abundance.py',
Fixes missing comma from requires array in setup.py
smdabdoub_phylotoast
train
py
0561fdf167162aaa1be2cd7521682f6e098ec71b
diff --git a/mod/quiz/report/grading/report.php b/mod/quiz/report/grading/report.php index <HASH>..<HASH> 100644 --- a/mod/quiz/report/grading/report.php +++ b/mod/quiz/report/grading/report.php @@ -484,7 +484,6 @@ class quiz_grading_report extends quiz_default_report { $transaction = $DB->start_delegated_transaction(); foreach ($qubaids as $qubaid) { $attempt = $attempts[$qubaid]; - $quba = question_engine::load_questions_usage_by_activity($qubaid); $attemptobj = new quiz_attempt($attempt, $this->quiz, $this->cm, $this->course); $attemptobj->process_submitted_actions(time()); }
MDL-<I> quiz manual grading: delete expensive unnecssary code.
moodle_moodle
train
php
21e86f9af000c1fed904a81520ba242369004778
diff --git a/plugins/PDFReports/API.php b/plugins/PDFReports/API.php index <HASH>..<HASH> 100644 --- a/plugins/PDFReports/API.php +++ b/plugins/PDFReports/API.php @@ -270,7 +270,16 @@ class Piwik_PDFReports_API { $aggregateReportsFormat = Piwik_PDFReports::DEFAULT_AGGREGATE_REPORTS_FORMAT; } - $reports = $reportMetadata; + + $reports = array(); + foreach($reportMetadata as $report) + { + if($report['category'] != 'API') + { + $reports[] = $report; + } + } + $description = Piwik_Translate('PDFReports_DefaultContainingAllReports'); } // Template is a custom template
refs #<I>, r<I> - API category reports also need to be excluded in the test report ($idReport == 0) git-svn-id: <URL>
matomo-org_matomo
train
php
928836dc1394498982c29b3f3b2ef25b36a5e855
diff --git a/performanceplatform/collector/gcloud/core.py b/performanceplatform/collector/gcloud/core.py index <HASH>..<HASH> 100755 --- a/performanceplatform/collector/gcloud/core.py +++ b/performanceplatform/collector/gcloud/core.py @@ -8,6 +8,7 @@ import re import scraperwiki from dshelpers import batch_processor +from dateutil.parser import parse as parse_datetime from performanceplatform.client import JsonEncoder @@ -51,7 +52,16 @@ def push_aggregates(data_set): with batch_processor(data_set.post) as uploader: for row in scraperwiki.sqlite.select('* FROM {}'.format(table)): - uploader.push(row) + uploader.push(format_timestamp(row)) + + +def format_timestamp(row): + """ + >>> format_timestamp({'_timestamp': '2012-12-12 00:00'}) + {u'_timestamp': u'2012-12-12T00:00:00Z'} + """ + row['_timestamp'] = parse_datetime(row['_timestamp']).isoformat() + 'Z' + return row def save_to_json():
Convert gcloud datetimes to ISO<I> These were working before we added json schemas because dateutil.parser was able to parse them in backdrop. However, they are not ISO<I> so the schema validation fails.
alphagov_performanceplatform-collector
train
py
8c05a125dc0cfb28e29fc6004ee26607ab99eba8
diff --git a/build.go b/build.go index <HASH>..<HASH> 100644 --- a/build.go +++ b/build.go @@ -334,9 +334,7 @@ func gruntBuildArg(task string) []string { func setup() { runPrint("go", "get", "-v", "github.com/kardianos/govendor") - runPrint("go", "get", "-v", "github.com/blang/semver") - runPrint("go", "get", "-v", "github.com/mattn/go-sqlite3") - runPrint("go", "install", "-v", "github.com/mattn/go-sqlite3") + runPrint("go", "install", "-v", "./pkg/cmd/grafana-server") } func test(pkg string) {
fix(build): updated build.go setup
grafana_grafana
train
go
1eb6766a1a57d8da7ad2c3c8337d04f1d5995441
diff --git a/planet/scripts/__init__.py b/planet/scripts/__init__.py index <HASH>..<HASH> 100644 --- a/planet/scripts/__init__.py +++ b/planet/scripts/__init__.py @@ -625,11 +625,12 @@ def _item_types_parse(ctx, param, values): if not values: incoming = [] # accept no input from item-type if filter_json has some - try: - incoming = json.loads( - ctx.params['filter_json']).get('item_types', []) - except ValueError: - pass + if 'filter_json' in ctx.params: + try: + incoming = json.loads( + ctx.params['filter_json']).get('item_types', []) + except ValueError: + pass return incoming or _allowed_item_types return values
sniffing for incoming item_types should not die
planetlabs_planet-client-python
train
py
21edfa8d639c4d41845b0ac85b73bbf593275acd
diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index <HASH>..<HASH> 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -442,7 +442,7 @@ module.exports = Backbone.View.extend({ const onRender = this.onRender && this.onRender.bind(this); onRender && onRender(); - this.setValue(model.get('value')); + this.setValue(model.get('value'), {targetUpdate: 1}); }, });
Add targetUpdate on setValue on property render
artf_grapesjs
train
js